-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.js
69 lines (68 loc) · 1.94 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
const env = (prod, dev) => (process.env.NODE_ENV === 'production' ? prod : dev);
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2016,
sourceType: 'module',
createDefaultProgram: true,
project: './tsconfig.json',
},
plugins: ['react'],
extends: ['react-app', 'prettier', 'prettier/prettier'],
env: {
browser: true,
es6: true,
jest: true,
serviceworker: true,
},
rules: {
quotes: [
'error',
'single',
{
avoidEscape: true,
},
],
'no-multiple-empty-lines': 'error',
'no-console': env(1, 0),
'no-debugger': env(1, 0),
'@typescript-eslint/no-unused-vars': [
env(2, 1),
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'import/prefer-default-export': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/jsx-pascal-case': 'error',
'react/jsx-closing-bracket-location': 'error',
'react/jsx-closing-tag-location': 'error',
'react/jsx-tag-spacing': 'error',
'react/jsx-curly-spacing': 'error',
'react/jsx-boolean-value': 'error',
'react/no-string-refs': 'error',
'react/jsx-wrap-multilines': 'error',
'react/self-closing-comp': 'error',
'jsx-a11y/no-access-key': 'error',
'jsx-a11y/aria-role': 'error',
'jsx-a11y/alt-text': 'error',
'jsx-a11y/img-redundant-alt': 'error',
'jsx-quotes': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['block-like', 'class', 'function'], next: 'export' },
],
'@typescript-eslint/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['interface'], next: '*' },
{ blankLine: 'always', next: ['interface'], prev: '*' },
],
},
};