-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
87 lines (82 loc) · 2.2 KB
/
.eslintrc.js
File metadata and controls
87 lines (82 loc) · 2.2 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
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
module.exports = {
root: true,
env: {
browser: true,
'jest/globals': true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
},
extends: ['airbnb', 'eslint:recommended'],
plugins: ['react', '@typescript-eslint', 'simple-import-sort', 'jest'],
rules: {
// base rules
'no-console': 2,
'no-shadow': 0,
'arrow-parens': 0,
'operator-linebreak': 0,
'global-require': 0,
'comma-dangle': 0,
'eol-last': 0,
'implicit-arrow-linebreak': 0,
indent: 0,
// react
'react/jsx-filename-extension': [
2,
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
],
'react/jsx-one-expression-per-line': 0,
'react/prop-types': 0,
// import
'import/no-unresolved': 0,
'import/named': 2,
'import/namespace': 2,
'import/default': 2,
'import/export': 2,
'import/no-extraneous-dependencies': 0,
'import/extensions': 0,
'import/prefer-default-export': 0,
// typescript
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/consistent-type-imports': 2,
// simple-import-sort
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages. `react` related packages come first.
['^react', '^@?\\w'],
// Internal packages.
['^(@|@company|@ui|components|utils|config|vendored-lib)(/.*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.s?css$'],
],
},
],
'simple-import-sort/exports': 'error',
// jest
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
};