when-am-i / files / eslint.config.js
eslint.config.js
| 1 | import js from '@eslint/js'; |
| 2 | import tseslint from 'typescript-eslint'; |
| 3 | import reactHooks from 'eslint-plugin-react-hooks'; |
| 4 | import reactRefresh from 'eslint-plugin-react-refresh'; |
| 5 | |
| 6 | export default tseslint.config( |
| 7 | { ignores: ['dist', 'node_modules', 'temp'] }, |
| 8 | js.configs.recommended, |
| 9 | ...tseslint.configs.recommended, |
| 10 | { |
| 11 | files: ['src/**/*.{ts,tsx}'], |
| 12 | plugins: { |
| 13 | 'react-hooks': reactHooks, |
| 14 | 'react-refresh': reactRefresh, |
| 15 | }, |
| 16 | rules: { |
| 17 | ...reactHooks.configs.recommended.rules, |
| 18 | 'react-refresh/only-export-components': [ |
| 19 | 'warn', |
| 20 | { allowConstantExport: true }, |
| 21 | ], |
| 22 | // No stray debug logging in shipped code; console.warn/error are |
| 23 | // allowed for genuine diagnostics (see utils/report.ts). |
| 24 | 'no-console': ['error', { allow: ['warn', 'error'] }], |
| 25 | }, |
| 26 | }, |
| 27 | ); |