Testing & Code Quality
ESLint & typescript-eslint
ESLint catches code-quality and correctness issues through configurable rules. typescript-eslint lets ESLint parse TypeScript and run TypeScript-aware rules that use compiler type information.
- Linting is automated code review for repeatable concerns
- Typed rules are more powerful and more expensive
- Rule severity should reflect real risk
- Flat config is the modern ESLint configuration direction
- Linting should support project style, not become the project
export default [
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parserOptions: {
projectService: true,
},
},
rules: {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-explicit-any": "warn",
},
},
]| Category | Example |
|---|---|
| Correctness | no-floating-promises |
| Safety | no-explicit-any / no-unsafe-assignment |
| Maintainability | no-unused-vars, complexity |
| Style consistency | naming conventions |
| Framework rules | React hooks, testing-library rules |