-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
46 lines (46 loc) · 1.28 KB
/
.eslintrc.cjs
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
module.exports = {
env: { browser: true, es2021: true },
overrides: [
{
env: { node: true },
files: ['.eslintrc.{js,cjs}'],
parserOptions: { sourceType: 'script' },
},
],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: {
react: { version: 'detect' },
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
},
plugins: ['unused-imports', 'import'],
rules: {
'react/jsx-filename-extension': ['error', { extensions: ['.jsx'] }],
'react/self-closing-comp': 'error',
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-use-before-define': 'error',
'arrow-body-style': 'error',
'unused-imports/no-unused-imports': 'error',
'import/no-unresolved': 'error',
'import/no-duplicates': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', ['sibling', 'index']],
alphabetize: { order: 'asc', orderImportKind: 'asc' },
'newlines-between': 'never',
},
],
'import/newline-after-import': 'error',
},
};