This commit is contained in:
2026-01-14 18:02:47 +01:00
parent 2c41f5619b
commit 558bcbd946
68 changed files with 5490 additions and 4032 deletions

View File

@@ -14,6 +14,9 @@ export default [
'data/**',
// Scripts + config files are not part of the frontend lint target.
'scripts/**',
// …except the PDF generator which is maintained runtime code.
'!scripts/pdf/**',
'!scripts/generate-pdf-datasheets.ts',
'next.config.*',
'postcss.config.js',
'tailwind.config.*',
@@ -21,6 +24,47 @@ export default [
],
},
js.configs.recommended,
{
// Allow linting the React-PDF generator despite global `scripts/**` ignore.
// These files are runtime code (not throwaway scripts) and should stay clean.
files: ['scripts/pdf/**/*.{ts,tsx}', 'scripts/generate-pdf-datasheets.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
globals: {
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
require: 'readonly',
module: 'readonly',
fetch: 'readonly',
React: 'readonly',
JSX: 'readonly',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
react,
},
rules: {
...tsPlugin.configs.recommended.rules,
...react.configs.recommended.rules,
'no-undef': 'error',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
},
settings: {
react: { version: 'detect' },
},
},
{
// Only lint the actual source files, not build output or scripts
files: ['app/**/*.{ts,tsx}', 'components/**/*.{ts,tsx}', 'lib/**/*.{ts,tsx}'],