-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
58 lines (57 loc) · 1.3 KB
/
.eslintrc.js
File metadata and controls
58 lines (57 loc) · 1.3 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
/* eslint-env node */
module.exports = {
env: {
browser: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['prettier', 'react-hooks', '@typescript-eslint'],
rules: {
'prettier/prettier': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/consistent-type-assertions': [
'warn',
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' },
],
'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
'@typescript-eslint/consistent-type-imports': ['warn', { prefer: 'type-imports' }],
'no-restricted-syntax': [
'error',
{
selector:
"CallExpression[arguments.length=1] > MemberExpression.callee > Identifier.property[name='reduce']",
message: 'Provide initialValue to .reduce().',
},
],
'no-mixed-spaces-and-tabs': 'off',
},
settings: {
react: {
version: 'detect',
},
},
overrides: [
{
files: ['*.spec.*'],
env: {
jest: true,
},
},
{
files: ['./stories/**/*.*'],
rules: {
// 'react/prop-types': 'off',
},
},
],
};