-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
51 lines (50 loc) · 1.38 KB
/
eslint.config.js
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
import eslintPluginPrettier from 'eslint-plugin-prettier'
import eslintPluginReact from 'eslint-plugin-react'
import eslintPluginImport from 'eslint-plugin-import'
import eslintRecommendedConfig from '@eslint/js'
import prettierRecommendedConfig from 'eslint-config-prettier'
export default [
eslintRecommendedConfig.configs.recommended,
prettierRecommendedConfig,
{
ignores: ['node_modules/', 'dist/', 'idea/', '.vscode/', '.git/']
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
browser: true,
node: true
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},
plugins: {
prettier: eslintPluginPrettier,
react: eslintPluginReact,
import: eslintPluginImport
},
settings: {
react: {
version: 'detect'
}
},
rules: {
'prettier/prettier': ['error'],
// React rules
'react/jsx-uses-react': 'off', // Not needed in React 17+
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
'react/jsx-no-constructed-context-values': 'error',
'react/jsx-no-bind': ['warn', { allowArrowFunctions: true }],
'react/jsx-key': 'error',
'react/display-name': 'warn',
// Import rules
'import/no-anonymous-default-export': 'off'
}
}
]