Add ESLint for TypeScript/React linting
- Install eslint, typescript-eslint, eslint-plugin-react-hooks - Configure eslint.config.js with flat config format - Add type: module to package.json - Fix unused variable issues (prefix with underscore) - Add Makefile targets: lint-frontend, fix-frontend
This commit is contained in:
parent
30583805cd
commit
4b394b0698
12 changed files with 1467 additions and 16 deletions
31
frontend/eslint.config.js
Normal file
31
frontend/eslint.config.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import eslint from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
plugins: {
|
||||
'react-hooks': reactHooks,
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
||||
],
|
||||
// Downgrade to warnings - existing patterns use these
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
'react-hooks/set-state-in-effect': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: [
|
||||
'.next/**',
|
||||
'node_modules/**',
|
||||
'app/generated/**',
|
||||
],
|
||||
}
|
||||
);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue