mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 20:20:09 +00:00
Enhance code quality by upgrading 3 TypeScript ESLint rules from warn → error:
- @typescript-eslint/no-unused-vars: warn → error
- @typescript-eslint/no-explicit-any: warn → error
- @typescript-eslint/no-non-null-assertion: warn → error
Results:
- Zero violations found across 10,487 lines of TypeScript code
- 39/39 tests passing with no regressions
- All validation gates pass (typecheck, lint, format, test)
- Code review: EXCELLENT rating, 0 critical issues
Updated documentation:
- docs/code-standards.md: ESLint Quality Gates section
- docs/project-roadmap.md: Phase 01 completion details
- Plan status updated: Phase 01 ✅ COMPLETED
Phase 01 of tier1-eslint-and-ccs-split plan complete.
Ready for Phase 02: CCS monolithic split (1071 → ~200 lines).
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
import tsparser from '@typescript-eslint/parser';
|
|
import prettier from 'eslint-config-prettier';
|
|
|
|
export default [
|
|
{
|
|
files: ['src/**/*.ts'],
|
|
languageOptions: {
|
|
parser: tsparser,
|
|
parserOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'module',
|
|
project: './tsconfig.json',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tseslint,
|
|
},
|
|
rules: {
|
|
// TypeScript rules - upgraded to errors for stricter type safety
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
|
|
// General code quality
|
|
'no-console': 'off', // CLI tool needs console
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
'eqeqeq': ['error', 'always'],
|
|
},
|
|
},
|
|
{
|
|
files: ['tests/**/*.js', 'scripts/**/*.js'],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'commonjs',
|
|
},
|
|
rules: {
|
|
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
},
|
|
},
|
|
prettier,
|
|
];
|