-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
54 lines (53 loc) · 1.63 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import nextPlugin from '@next/eslint-plugin-next';
import reactPlugin from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import prettierPlugin from 'eslint-plugin-prettier';
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
export default [
{
ignores: ['node_modules/**'],
},
{
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.mjs'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: {
modules: true,
},
project: './tsconfig.json',
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: {
react: reactPlugin,
prettier: prettierPlugin,
'@next/next': nextPlugin,
'jsx-a11y': jsxA11yPlugin,
'react-hooks': hooksPlugin,
'@typescript-eslint': typescriptPlugin,
},
rules: {
...hooksPlugin.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
'no-console': 'warn',
'react/prop-types': 'off',
'prettier/prettier': 'error',
'jsx-a11y/no-autofocus': 'off',
'@next/next/no-img-element': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-unused-vars': ['error', { args: 'none' }],
'jsx-a11y/label-has-associated-control': 'off',
'react/function-component-definition': [2, { namedComponents: 'arrow-function' }],
},
},
];