-
Notifications
You must be signed in to change notification settings - Fork 67
/
.eslintrc.js
113 lines (108 loc) · 2.68 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
useJSXTextNode: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: [
// ...
'react',
'react-hooks',
'@typescript-eslint',
'prettier',
'@emotion',
],
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
env: {
es6: true,
node: true,
jest: true,
},
globals: {
document: true,
Promise: true,
window: true,
},
rules: {
// basic
curly: [2, 'multi-line'],
eqeqeq: [1, 'smart'],
'no-eval': 2,
'no-use-before-define': 'off',
quotes: [1, 'single', { allowTemplateLiterals: true }],
// indent: [2, 'tab', { SwitchCase: 1 }], // disabled - interferes with prettier
'no-trailing-spaces': 1,
// space between `ifHERE()HERE{}`
'keyword-spacing': [1, { before: true, after: true }],
'no-var': 1,
'space-before-function-paren': [
// MIGHT interferes with prettier
1,
{ anonymous: 'never', named: 'never', asyncArrow: 'ignore' },
],
'space-in-parens': [1, 'never'], // MIGHT interferes with prettier
'linebreak-style': 0,
'object-shorthand': ['error', 'properties'],
// typescript
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': [0],
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-use-before-define': [2, { functions: false }],
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/ban-ts-comment': 0,
// react hooks
'react-hooks/rules-of-hooks': 1,
'react-hooks/exhaustive-deps': 1,
// react
'react/react-in-jsx-scope': 'off',
'react/prop-types': 0,
'react/no-array-index-key': 1,
'react/jsx-curly-brace-presence': 1,
'react/no-typos': 'warn',
'react/self-closing-comp': [1, { component: true, html: true }],
'react/display-name': 0,
'prettier/prettier': [
'error',
{
arrowParens: 'avoid',
bracketSpacing: true,
printWidth: 90,
proseWrap: 'preserve',
requirePragma: false,
semi: false,
singleQuote: true,
tabWidth: 4,
trailingComma: 'all',
useTabs: true,
},
{
usePrettierrc: false,
},
],
},
ignorePatterns: ['z_*', 'z_*/'],
}