-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
98 lines (98 loc) · 2.46 KB
/
.eslintrc.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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = {
extends: [
'react-app',
'prettier',
'plugin:react/recommended',
'plugin:import/typescript',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:prettier/recommended',
'prettier/react',
],
plugins: ['react', 'prettier', 'import', 'simple-import-sort'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
modules: true,
},
},
rules: {
'no-duplicate-imports': 'error',
'sort-imports': 'off',
'import/order': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages. `react` related packages come first.
['^react', '^\\w', '^@?\\w'],
// Internal packages.
[
'^@/.*|$',
'^@interfaces/.*|$',
'^@constants/.*|$',
'^@resources/.*|$',
'^@utils/.*|$',
'^@services/.*|$',
'^@apis/.*|$',
'^@data/.*|$',
'^@hooks/.*|$',
'^@pages/.*|$',
'^@components/.*|$',
'^@styles/.*|$',
],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.s?css$'],
// Side effect imports.
['^\\u0000'],
],
},
],
'prettier/prettier': [
'warn',
{
arrowParens: 'always',
bracketSpacing: true,
semi: false,
trailingComma: 'all',
endOfLine: 'lf',
tabWidth: 2,
singleQuote: true,
printWidth: 80,
useTabs: false,
},
],
'no-console': 'warn',
'react/prop-types': 0,
'newline-before-return': 1,
'no-useless-return': 1,
'prefer-const': 1,
'no-unused-vars': 0,
},
settings: {
'import/resolver': {
typescript: {},
// alias: {
// map: [
// ['@', './src'],
// ['@utils', './src/client/utils'],
// ['@resources', './src/resources'],
// ],
// extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
// },
},
react: {
version: 'detect',
},
},
}