-
Notifications
You must be signed in to change notification settings - Fork 50
/
eslint.config.mjs
47 lines (46 loc) · 1.44 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
import reactPlugin from 'eslint-plugin-react';
import importPlugin from 'eslint-plugin-import';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import hooksPlugin from 'eslint-plugin-react-hooks';
import prettierPlugin from 'eslint-plugin-prettier';
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
export default [
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: {
react: reactPlugin,
import: importPlugin,
prettier: prettierPlugin,
'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',
'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' }],
},
},
];