Project Standards Config
Claude Code settings preset that enforces consistent coding standards. Configures TypeScript strict mode, ESLint rules, Prettier formatting, and naming conventions.
Project Standards Config
Overview
A Claude Code settings preset that establishes consistent coding standards, formatting rules, and development conventions across your project. Generates configuration files for linting, formatting, TypeScript, Git hooks, editor settings, and CI β ensuring every team member writes code that follows the same rules.
Quick Start
# Apply the standards config to your project claude "Set up project standards with TypeScript strict mode, ESLint, Prettier, and Husky" # Or apply a specific stack preset claude "Configure project standards for a Next.js + TypeScript + Tailwind project"
What Gets Configured
project-root/
βββ .editorconfig # Editor-agnostic formatting
βββ .prettierrc # Code formatting rules
βββ .prettierignore # Files to skip formatting
βββ .eslintrc.js # Linting rules
βββ .eslintignore # Files to skip linting
βββ tsconfig.json # TypeScript compiler options
βββ .gitignore # Git ignore patterns
βββ .gitattributes # Git line endings & diff settings
βββ .husky/
β βββ pre-commit # Run lint-staged before commit
β βββ commit-msg # Validate commit message format
βββ .lintstagedrc # Run linters on staged files only
βββ .nvmrc # Node.js version
βββ .claude/
β βββ settings.json # Claude Code project settings
βββ .vscode/
βββ settings.json # VS Code workspace settings
βββ extensions.json # Recommended extensions
Editor Configuration
.editorconfig
Universal settings respected by all major editors:
# .editorconfig root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [*.{yml,yaml}] indent_size = 2 [Makefile] indent_style = tab [*.go] indent_style = tab [*.py] indent_size = 4
VS Code Workspace Settings
// .vscode/settings.json { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit", "source.organizeImports": "explicit" }, "editor.tabSize": 2, "editor.rulers": [100], "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "typescript.preferences.importModuleSpecifier": "relative", "typescript.tsdk": "node_modules/typescript/lib", "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" } }
// .vscode/extensions.json { "recommendations": [ "esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "editorconfig.editorconfig", "bradlc.vscode-tailwindcss", "ms-vscode.vscode-typescript-next" ] }
Formatting (Prettier)
Configuration
// .prettierrc { "semi": true, "singleQuote": true, "trailingComma": "all", "printWidth": 100, "tabWidth": 2, "useTabs": false, "bracketSpacing": true, "arrowParens": "always", "endOfLine": "lf", "jsxSingleQuote": false, "quoteProps": "as-needed" }
# .prettierignore
node_modules/
dist/
build/
.next/
coverage/
*.min.js
package-lock.json
pnpm-lock.yaml
Why These Rules?
| Rule | Value | Rationale |
|---|---|---|
semi | true | Prevents ASI-related bugs |
singleQuote | true | Less visual noise, consistent with JS ecosystem |
trailingComma | "all" | Cleaner git diffs, easier reordering |
printWidth | 100 | Readable on modern screens without excessive wrapping |
arrowParens | "always" | Consistent, easier to add types later |
Linting (ESLint)
TypeScript + React Configuration
// .eslintrc.js module.exports = { root: true, parser: '@typescript-eslint/parser', parserOptions: { project: './tsconfig.json', ecmaVersion: 2024, sourceType: 'module', ecmaFeatures: { jsx: true }, }, env: { browser: true, node: true, es2024: true, jest: true, }, extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', 'plugin:react/recommended', 'plugin:react-hooks/recommended', 'plugin:jsx-a11y/recommended', 'plugin:import/typescript', 'prettier', // Must be last β disables conflicting rules ], plugins: ['@typescript-eslint', 'react', 'react-hooks', 'jsx-a11y', 'import'], settings: { react: { version: 'detect' }, 'import/resolver': { typescript: {} }, }, rules: { // TypeScript '@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/no-floating-promises': 'error', // React 'react/react-in-jsx-scope': 'off', // Not needed in React 17+ 'react/prop-types': 'off', // Using TypeScript instead 'react-hooks/exhaustive-deps': 'warn', // Imports 'import/order': ['error', { groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], 'newlines-between': 'always', alphabetize: { order: 'asc' }, }], 'import/no-duplicates': 'error', // General 'no-console': ['warn', { allow: ['warn', 'error'] }], 'prefer-const': 'error', 'no-var': 'error', 'eqeqeq': ['error', 'always'], }, overrides: [ { files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts'], rules: { '@typescript-eslint/no-explicit-any': 'off', 'no-console': 'off', }, }, ], };
TypeScript Configuration
Strict Mode
// tsconfig.json { "compilerOptions": { // Strictness "strict": true, "noUncheckedIndexedAccess": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "noPropertyAccessFromIndexSignature": true, // Module system "target": "ES2022", "module": "ESNext", "moduleResolution": "bundler", "esModuleInterop": true, "resolveJsonModule": true, // Output "outDir": "dist", "declaration": true, "declarationMap": true, "sourceMap": true, // Path aliases "baseUrl": ".", "paths": { "@/*": ["src/*"], "@/components/*": ["src/components/*"], "@/lib/*": ["src/lib/*"], "@/types/*": ["src/types/*"] }, // Other "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "incremental": true, "jsx": "react-jsx" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "coverage"] }
Why Strict Mode?
| Flag | What It Catches |
|---|---|
strict | Enables all strict checks (noImplicitAny, strictNullChecks, etc.) |
noUncheckedIndexedAccess | array[0] returns T | undefined instead of T |
noImplicitReturns | Every code path must return a value |
noFallthroughCasesInSwitch | Prevents missing break in switch |
Git Configuration
.gitignore
# Dependencies node_modules/ # Build output dist/ build/ .next/ out/ # Environment .env .env.local .env.*.local # IDE .vscode/* !.vscode/settings.json !.vscode/extensions.json .idea/ *.swp *.swo # OS .DS_Store Thumbs.db # Testing coverage/ # Logs *.log npm-debug.log* # Misc *.tsbuildinfo
.gitattributes
# Normalize line endings
* text=auto eol=lf
# Binary files
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.woff binary
*.woff2 binary
# Diff settings
*.ts diff=typescript
*.tsx diff=typescript
*.css diff=css
*.md diff=markdown
Git Hooks (Husky + lint-staged)
Setup
npx husky init npm install --save-dev lint-staged
Pre-commit Hook
#!/bin/sh # .husky/pre-commit npx lint-staged
Commit Message Validation
#!/bin/sh # .husky/commit-msg npx --no -- commitlint --edit ${1}
lint-staged Configuration
// .lintstagedrc { "*.{ts,tsx}": [ "eslint --fix", "prettier --write" ], "*.{json,md,yml,yaml}": [ "prettier --write" ], "*.css": [ "prettier --write" ] }
Commitlint Configuration
// commitlint.config.js module.exports = { extends: ['@commitlint/config-conventional'], rules: { 'type-enum': [2, 'always', [ 'feat', 'fix', 'docs', 'style', 'refactor', 'test', 'chore', 'perf', 'ci', 'build', 'revert', ]], 'subject-max-length': [2, 'always', 72], 'body-max-line-length': [2, 'always', 100], }, };
Stack-Specific Presets
Next.js + Tailwind
Adds to the base config:
// next.config.js additions { "reactStrictMode": true, "images": { "formats": ["image/avif", "image/webp"] } }
// tailwind.config.ts export default { content: ['./src/**/*.{ts,tsx}'], theme: { extend: {} }, plugins: [], };
Node.js Backend
Adjusts ESLint for server-side:
// Additional rules for backend { 'no-console': 'off', // Console is fine in server code '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/require-await': 'error', }
Monorepo (Turborepo)
// turbo.json { "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] }, "lint": {}, "test": { "dependsOn": ["build"] }, "dev": { "cache": false, "persistent": true } } }
Installation Commands
# Core dependencies npm install -D typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin npm install -D eslint eslint-config-prettier eslint-plugin-import npm install -D prettier # React-specific npm install -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y # Git hooks npm install -D husky lint-staged @commitlint/cli @commitlint/config-conventional # Initialize Husky npx husky init
Package.json Scripts
{ "scripts": { "dev": "next dev", "build": "next build", "lint": "eslint src/ --ext .ts,.tsx", "lint:fix": "eslint src/ --ext .ts,.tsx --fix", "format": "prettier --write 'src/**/*.{ts,tsx,json,css,md}'", "format:check": "prettier --check 'src/**/*.{ts,tsx,json,css,md}'", "type-check": "tsc --noEmit", "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage", "prepare": "husky" } }
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Bedrock Configuration Blueprint
All-in-one setting covering configure, claude, code, amazon. Includes structured workflows, validation checks, and reusable patterns for api.
Refined Corporate Preset
Production-ready setting that handles configure, proxy, settings, corporate. Includes structured workflows, validation checks, and reusable patterns for api.
Refined Custom Preset
Battle-tested setting for custom, headers, requests, specialized. Includes structured workflows, validation checks, and reusable patterns for api.