-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
85 lines (85 loc) · 2.56 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
module.exports = {
root: true,
env: {
browser: true,
es2020: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@typescript-eslint', 'react', 'prettier', 'unused-imports'],
extends: [
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier',
'plugin:react-hooks/recommended',
],
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
quotes: ['error', 'single', { allowTemplateLiterals: true }],
'prettier/prettier': 'error',
'react/no-unescaped-entities': 'off',
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'import/order': [
'error',
{
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern:
'{@{api,apps,components,hooks,contexts,layouts,pages,icons,models,network}/**,@apps}',
group: 'internal',
position: 'after',
},
],
'newlines-between': 'always',
alphabetize: {
/* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */
order: 'asc',
caseInsensitive: true /* ignore case. Options: [true, false] */,
},
pathGroupsExcludedImportTypes: ['builtin'],
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'import/no-unresolved': 'off',
'import/namespace': 'off',
'import/no-duplicates': 'off',
'no-console': 'warn',
'guard-for-in': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'react/prop-types': 'off',
'react/display-name': 'off',
'import/default': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'react/react-in-jsx-scope': 'off',
'unused-imports/no-unused-imports': 'warn',
},
};