Clears the six npm deprecation warnings that fire on every deploy:
inflight, @humanwhocodes/config-array, rimraf, glob,
@humanwhocodes/object-schema, and eslint 8.57 itself — all transitive
deps of the eslint v8 chain.
- eslint 8.57 → 9.10
- @typescript-eslint/{parser,eslint-plugin} 7.x → typescript-eslint 8.7
(single combined package in v8)
- eslint-plugin-react-hooks 4 → 5 (v5 supports flat config)
- eslint-plugin-react 7.34 → 7.36
- Replace .eslintrc.cjs with eslint.config.js (flat config)
- `npm run lint` switches from --ext flag (legacy) to flat-config lookup
typecheck silent, lint silent, build identical bundle (45.93 KB raw,
15.76 KB gzip on the main entry).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
// Flat config — replaces the legacy .eslintrc.cjs. ESLint 9 + typescript-eslint 8.
|
|
import js from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import react from 'eslint-plugin-react';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import globals from 'globals';
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [
|
|
'dist/**',
|
|
'node_modules/**',
|
|
'vite.config.ts',
|
|
'postcss.config.js',
|
|
'tailwind.config.js',
|
|
'eslint.config.js',
|
|
],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
parserOptions: { ecmaFeatures: { jsx: true } },
|
|
globals: { ...globals.browser, ...globals.es2020 },
|
|
},
|
|
plugins: {
|
|
react,
|
|
'react-hooks': reactHooks,
|
|
},
|
|
settings: { react: { version: '18.3' } },
|
|
rules: {
|
|
...react.configs.recommended.rules,
|
|
...reactHooks.configs.recommended.rules,
|
|
'react/react-in-jsx-scope': 'off',
|
|
'react/prop-types': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
],
|
|
},
|
|
},
|
|
);
|