wip
This commit is contained in:
@@ -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}'],
|
||||
|
||||
Reference in New Issue
Block a user