-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
121 lines (121 loc) · 3.4 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
module.exports = {
root: true,
extends: ['airbnb-base', 'plugin:prettier/recommended', 'plugin:@typescript-eslint/recommended'],
env: {
browser: true,
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2020,
sourceType: 'module',
},
overrides: [
{
files: ['./src/contexts/**.context.tsx'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
},
{
files: ['**.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
plugins: ['@typescript-eslint/eslint-plugin', 'import', 'simple-import-sort'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
alias: {
map: [
['@dev', './src/.dev'],
['@atoms', './src/components/atoms/'],
['@molecules', './src/components/molecules/'],
['@organisms', './src/components/organisms/'],
['@helpers', './src/helpers/'],
['@styles', './src/styles/'],
['@assets', './src/assets/'],
['@type', './src/type/'],
],
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
},
},
rules: {
curly: ['error', 'all'],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/no-default-export': ['off'],
'import/order': 'off',
'no-restricted-syntax': 'off',
'import/prefer-default-export': 'off',
'no-duplicate-imports': 'off',
'no-console': 'off',
'no-await-in-loop': 'off',
'no-plusplus': 'off',
'@typescript-eslint/no-duplicate-imports': ['error', { includeExports: true }],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-underscore-dangle': ['error'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'padding-line-between-statements': ['error', { blankLine: 'always', prev: '*', next: 'return' }],
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
'eol-last': ['error', 'always'],
'@typescript-eslint/prefer-optional-chain': ['error'],
'keyword-spacing': [
'error',
{
before: false,
after: true,
overrides: {
from: { before: true, after: true },
else: { before: true, after: true },
catch: { before: true, after: true },
as: { before: true, after: true },
finally: { before: true, after: true },
},
},
],
'simple-import-sort/exports': ['error'],
'simple-import-sort/imports': [
'error',
{
groups: [
[
// Side effect imports.
'^\\u0000',
// Packages. `react` related packages come first.
'^react',
'^@?\\w',
// Internal packages.
'^(components|modules|utils)(/.*|$)',
// Parent imports. Put `..` last.
'^\\.\\.(?!/?$)',
'^\\.\\./?$',
// Other relative imports. Put same-folder imports and `.` last.
'^\\./(?=.*/)(?!/?$)',
'^\\.(?!/?$)',
'^\\./?$',
// Style imports.
'^.+\\.s?css$',
],
],
},
],
},
};