-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
117 lines (117 loc) · 2.54 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
browser: true,
node: true,
},
extends: [
'plugin:react/recommended',
'plugin:import/typescript',
'plugin:storybook/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
],
plugins: [
'react',
'@typescript-eslint',
'import',
],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
'typescript': {},
},
'jsx-a11y': {
'polymorphicPropName': 'component',
},
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
},
ignorePatterns: ['app/javascript/**/*'],
rules: {
indent: 'off',
'@typescript-eslint/indent': ['error', 'tab', {
SwitchCase: 1,
VariableDeclarator: 'first',
MemberExpression: 1,
ArrayExpression: 1,
ignoredNodes: ['TSTypeParameterInstantiation'],
}],
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: {
delimiter: 'none',
},
singleline: {
delimiter: 'comma',
},
multilineDetection: 'brackets',
}],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'no-unused-vars': ['warn', {
vars: 'all',
args: 'none',
}],
'no-prototype-builtins': [0],
'space-infix-ops': ['error'],
'no-trailing-spaces': 'error',
'object-curly-spacing': [2, 'always', {
objectsInObjects: true,
}],
'computed-property-spacing': 2,
'array-bracket-spacing': 0,
'brace-style': ['error', '1tbs', {
allowSingleLine: true,
}],
'react/boolean-prop-naming': ['error'],
'react/no-typos': ['error'],
'react/jsx-curly-spacing': ['error', {
when: 'always',
children: true,
}],
// 'react/jsx-space-before-closing': 2,
'react/jsx-tag-spacing': ['error', {
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
beforeClosing: 'allow',
}],
'react/display-name': ['off'],
'react/prop-types': 0,
eqeqeq: 'error',
'no-console': 'warn',
'eol-last': ['error', 'always'],
'@typescript-eslint/keyword-spacing': [2, {
after: true,
before: true,
overrides: {
if: { after: false },
for: { after: false },
while: { after: false },
switch: { after: false },
catch: { after: false },
},
}],
'comma-dangle': ['error', 'always-multiline'],
'react-hooks/exhaustive-deps': 0,
},
overrides: [
{
files: ['*.d.ts'],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/indent': 'off',
},
},
],
}