-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
78 lines (77 loc) · 1.97 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
const OFF = 0;
const WARN = 1;
const ERROR = 2;
module.exports = {
extends: [
'airbnb',
'prettier',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['prettier'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
ignorePatterns: ['node_modules/', 'build'],
rules: {
'react/require-default-props': OFF, // TODO
'react/jsx-props-no-spreading': OFF, // TODO
'prettier/prettier': ['error'],
'react/jsx-filename-extension': [
1,
{
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
// allow console and debugger in development
'no-console': process.env.NODE_ENV === 'production' ? ERROR : WARN,
'no-debugger': process.env.NODE_ENV === 'production' ? ERROR : WARN,
// warn: Something is defined but never used
'no-unused-vars': [
WARN,
{ vars: 'all', args: 'after-used', ignoreRestSiblings: false },
],
// warn: Prefer default export
'import/prefer-default-export': OFF,
// warn: Something is already declared in the upper scope
'no-shadow': [
WARN,
{ builtinGlobals: false, hoist: 'functions', allow: [] },
],
// Interface name must not be prefixed with "I"
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true,
},
},
],
'no-param-reassign': OFF,
'jsx-a11y/click-events-have-key-events': OFF,
'jsx-a11y/no-static-element-interactions': OFF,
'jsx-a11y/no-noninteractive-element-interactions': OFF,
},
env: {
browser: true,
jest: true,
},
};