-
Notifications
You must be signed in to change notification settings - Fork 4
Linting and Formatting
Consistent linting, formatting, and naming conventions ensure that all practicum codebases remain clean, readable, and predictable β regardless of which IDE or language you use.
This page outlines the required tools and rules used across student projects, with deeper details available in each section below.
View Prettier Rules
Prettier is our primary code formatter for JavaScript, TypeScript, JSON, Markdown, CSS, and more.
It ensures that code remains consistent across all team members, regardless of IDE or OS.
Most practicum repos include a pre-configured .prettierrc file.
Example configuration:
{
"singleQuote": true,
"semi": false,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 80
}- Enable Format on Save in your IDE
- Do not change formatting rules per file
- Let Prettier handle spacing, semicolons, and quotes
- Avoid manual formatting β consistency > personal preference
View ESLint Conventions
ESLint catches bugs, enforces coding style, and ensures consistent behavior across JavaScript/TypeScript projects.
- Unused variables
- Incorrect imports
- Invalid TypeScript types
- Async/await issues
- Undefined variables
- Common React/Expo pitfalls
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-unused-vars": "warn",
"no-console": "off",
"@typescript-eslint/no-explicit-any": "warn"
}
}- Fix all lint errors before submitting a PR
- Avoid suppressing rules unless approved
- Use
// TODO:with an issue reference - Keep TypeScript typings strong (avoid
any)
View Auto-Formatting Instructions
Auto-formatting ensures consistency and saves time by fixing indentation, spacing, quotes, and more automatically.
- Go to Settings β search βFormat on Saveβ
- Enable checkbox
- Verify Prettier is selected as the default formatter
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}- Go to Preferences β Tools β Actions on Save
- Enable Reformat Code
- Enable Run Prettier
- Ensure Prettier path is detected
- Go to Settings β Tools β Actions on Save
- Enable:
- Reformat Code
- Optimize Imports
Android Studio does not use Prettier for Kotlin/Java, but auto-formatting still improves consistency.
View Naming Standards
Naming conventions ensure that codebases remain predictable and easy to navigate.
-
Use lowercase-hyphens for folders
components/login-screen/api-services/
-
Use camelCase for JavaScript/TypeScript files
userProfile.tsauthService.js
-
Use PascalCase for React/Expo components
HomeScreen.tsxLoginForm.tsx
-
Use snake_case for Python files
data_loader.pyuser_model.py
-
Use snake_case for SQL tables and columns
user_accountscreated_at
- Spaces in filenames
- Mixed naming styles
- Uppercase directory names
- Extremely long file names
-
Group by feature, not file type (for most JS/TS projects):
src/ login/ LoginScreen.tsx loginStyles.ts authService.ts dashboard/ DashboardScreen.tsx dashboardStyles.ts -
For Python, group modules by function or purpose
-
For SQL, group schema files by domain or migration number
Home β’ New Student Onboarding β’ Guides β’ Projects β’ Code of Conduct β’ FAQ
Last updated: 12/7/2025