-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.eslintrc.js
97 lines (94 loc) · 2.92 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
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'react-app',
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
'plugin:jsx-a11y/recommended',
'plugin:cypress/recommended',
],
plugins: [
'@typescript-eslint',
'react',
'jsdoc',
'jsx-a11y',
'simple-import-sort',
],
parserOptions: {
project: ['tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
'cypress/globals': true,
},
rules: {
// === plugin:@typescript-eslint/recommended ===
// === ref: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin ===
'@typescript-eslint/adjacent-overload-signatures': 'warn',
'@typescript-eslint/array-type': 'warn',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/unbound-method': 'off',
// === plugin:cypress/recommended ===
'cypress/no-unnecessary-waiting': 'off',
// === plugin:simple-import-sort ===
// === ref: https://github.com/lydell/eslint-plugin-simple-import-sort ===
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages. `react` related packages come first.
['^react', '^@?\\w'],
// Side effect imports.
['^\\u0000'],
// Other relative imports. Put same-folder imports and `.` last.
[
'^src/',
'^\\.\\.(?!/?$)',
'^\\.\\./?$',
'^\\./(?=.*/)(?!/?$)',
'^\\.(?!/?$)',
'^\\./?$',
],
// Type imports.
['^@?\\w.*\\u0000$', '^[^.].*\\u0000$', '^\\..*\\u0000$'],
// Style imports.
['^.+\\.s?css$'],
// Image imports.
['^.+\\.(png|jpg|jpeg|gif|svg)$'],
],
},
],
// === eslint ===
camelcase: 'off',
'comma-dangle': 'off',
'no-console': ['warn', { allow: ['debug', 'warn', 'error'] }],
'no-multiple-empty-lines': 'off',
'no-unused-expressions': 'off',
'no-use-before-define': 'off',
},
settings: {
react: {
version: 'detect',
},
},
};