- next lint removed in Next 16; add eslint@9 + eslint-config-next@16 - flat config imports eslint-config-next/core-web-vitals directly - add typescript devDep (required by eslint-config-next@16) - demote high-frequency pre-existing rule violations to warn Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
26 lines
887 B
JavaScript
26 lines
887 B
JavaScript
import next from 'eslint-config-next/core-web-vitals';
|
|
|
|
const eslintConfig = [
|
|
...next,
|
|
{
|
|
ignores: ['.next/**', 'node_modules/**', 'public/**'],
|
|
},
|
|
{
|
|
// قوانین پرتکراری که با ارتقا به eslint-config-next@16 / react-hooks@7 سختگیرتر شدند
|
|
// و در کد موجود نقض میشوند؛ برای عبور از ارتقا به warn تنزل داده شدهاند.
|
|
// پاکسازی این warningها خارج از scope این ارتقاست.
|
|
rules: {
|
|
'react/jsx-key': 'warn',
|
|
'react-hooks/set-state-in-effect': 'warn',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
'react-hooks/refs': 'warn',
|
|
'react-hooks/purity': 'warn',
|
|
'react-hooks/immutability': 'warn',
|
|
'jsx-a11y/alt-text': 'warn',
|
|
'@next/next/no-img-element': 'warn',
|
|
},
|
|
},
|
|
];
|
|
|
|
export default eslintConfig;
|