-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
148 lines (148 loc) · 3.66 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
module.exports = {
plugins: ['@emotion', 'jsx-a11y', 'react', 'react-hooks', 'import', 'jest'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 8,
tokens: true,
sourceType: 'module',
},
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
jest: true,
},
extends: [
'airbnb-base',
'prettier',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/all',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
alias: {
map: [
['~client', './src/client'],
['~api', './src/api'],
],
extensions: ['.js', '.tsx', '.ts'],
},
typescript: {
alwaysTryTypes: true,
},
},
react: {
version: 'detect',
},
},
rules: {
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-explicit-any': [
'error',
{
ignoreRestArgs: true,
},
],
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-var-requires': 'off',
camelcase: 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*spec.ts',
'**/*.spec.tsx',
'**/*.spec.js',
'jest.config.js',
'jest.api.integration.config.js',
'jest.api.unit.config.js',
'jest.client.config.js',
'src/**/__mocks__/**/*.ts',
'src/client/**/*.ts',
'src/client/**/*.tsx',
'src/api/migrate.ts',
'src/api/pre-index.js',
'src/api/test-utils/**/*.ts',
'src/api/test-utils/**/*.js',
'src/api/global.d.ts',
'src/api/**/__tests__/*',
'src/stories/**/*.ts',
'src/stories/**/*.tsx',
'scripts/**/*.ts',
'types/**/*.ts',
'webpack.*config.js',
],
},
],
'import/prefer-default-export': 'off',
'import/no-webpack-loader-syntax': 'off',
'jest/lowercase-name': 'off',
'jest/no-expect-resolves': 'off',
'jest/no-hooks': 'off',
'jest/prefer-expect-assertions': 'warn',
'jest/prefer-strict-equal': 'warn',
'jest/require-top-level-describe': 'off',
'jest/valid-title': [
'error',
{
ignoreTypeOfDescribeName: true,
},
],
'max-len': ['error', 120],
'no-bitwise': 'off',
'no-underscore-dangle': 'off',
'no-shadow': 'off',
'no-use-before-define': 'off',
'no-warning-comments': 'warn',
'react/jsx-filename-extension': [
2,
{
extensions: ['.js', '.jsx', '.tsx'],
},
],
'react/jsx-uses-react': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'no-undef-init': 'off',
'prefer-destructuring': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'@typescript-eslint/no-var-requires': ['error'],
},
},
],
};