-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy patheslint.config.mjs
More file actions
57 lines (56 loc) · 1.51 KB
/
Copy patheslint.config.mjs
File metadata and controls
57 lines (56 loc) · 1.51 KB
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
55
56
57
import eslintConfigPrettier from 'eslint-config-prettier'
import globals from 'globals'
import js from '@eslint/js'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import eslintPluginImport from 'eslint-plugin-import'
export default [
{ ignores: ['dist'] },
js.configs.recommended,
eslintConfigPrettier,
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
ecmaVersion: 2021,
globals: {
...globals.browser,
...globals.jest,
...globals.node
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},
plugins: {
react: react,
'react-hooks': reactHooks,
import: eslintPluginImport
},
settings: {
react: {
version: 'detect'
}
},
rules: {
...reactHooks.configs.recommended.rules,
...react.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'off',
'import/no-anonymous-default-export': 'off',
'import/named': process.env.NODE_ENV === 'production' ? 2 : 1,
'no-unused-vars': process.env.NODE_ENV === 'production' ? 2 : 1,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 1,
'no-console': process.env.NODE_ENV === 'production' ? 2 : 1,
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
semi: ['error', 'never']
}
},
{
files: ["**/*.test.jsx"],
rules: {
"import/named": "off"
}
}
]