49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import nextVitals from 'eslint-config-next/core-web-vitals'
|
|
import tseslint from 'typescript-eslint'
|
|
|
|
const eslintConfig = [
|
|
...nextVitals,
|
|
{
|
|
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
plugins: {
|
|
react: nextVitals[0].plugins.react,
|
|
'react-hooks': nextVitals[0].plugins['react-hooks'],
|
|
},
|
|
rules: {
|
|
'react/no-unescaped-entities': 'warn',
|
|
'react-hooks/immutability': 'warn',
|
|
'react-hooks/refs': 'warn',
|
|
'react-hooks/set-state-in-effect': 'warn',
|
|
'react-hooks/static-components': 'warn',
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.{ts,tsx,mts,cts}'],
|
|
plugins: {
|
|
'@typescript-eslint': tseslint.plugin,
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{
|
|
vars: 'all',
|
|
args: 'after-used',
|
|
ignoreRestSiblings: false,
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
destructuredArrayIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^(_|ignore)',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
ignores: ['.next/', 'src/payload-types.ts', 'src/payload-generated-schema.ts'],
|
|
},
|
|
]
|
|
|
|
export default eslintConfig
|