-
Notifications
You must be signed in to change notification settings - Fork 30
/
.eslintrc.js
211 lines (211 loc) · 5.74 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'prettier',
'plugin:react-hooks/recommended',
'airbnb',
],
overrides: [
{
files: 'packages/**/*.spec.{ts,tsx}',
plugins: ['jest', 'jest-dom'],
extends: [
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:jest-dom/recommended',
],
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'import'],
rules: {
'arrow-body-style': 'off',
'default-param-last': 'off',
'dot-notation': 'off',
'func-names': 'off',
'import/no-duplicates': 'off',
'import/no-useless-path-segments': 'off',
'lines-between-class-members': 'off',
'no-else-return': 'off',
'no-extra-boolean-cast': 'off',
'no-restricted-exports': 'off',
'no-unneeded-ternary': 'off',
'no-useless-computed-key': 'off',
'no-useless-return': 'off',
'object-shorthand': 'off',
'one-var': 'off',
'operator-assignment': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'off',
'prefer-object-spread': 'off',
'prefer-template': 'off',
'quote-props': 'off',
'react/jsx-boolean-value': 'off',
'react/jsx-closing-tag-location': 'off',
'react/jsx-curly-brace-presence': 'off',
'react/self-closing-comp': 'off',
'spaced-comment': 'off',
'comma-dangle': 'off',
'object-curly-newline': 'off',
'react/jsx-one-expression-per-line': 'off',
'no-confusing-arrow': 'off',
'function-paren-newline': 'off',
'react/jsx-wrap-multilines': 'off',
'nonblock-statement-body-position': 'off',
'react/jsx-curly-newline': 'off',
'react/jsx-indent': 'off',
'react/jsx-no-constructed-context-values': 'off',
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
'react/no-unstable-nested-components': 'off',
'react/no-unused-prop-types': 'off',
'consistent-return': 'off',
'default-case': 'off',
'global-require': 'off',
'implicit-arrow-linebreak': 'off',
'import/no-extraneous-dependencies': [
'error',
{
packageDir: [
'.',
'./packages/client',
'./packages/ibm',
'./packages/mco',
'./packages/ocs',
'./packages/odf',
'./packages/odf-plugin-sdk',
'./packages/shared',
],
devDependencies: [
'**/*.spec.ts',
'**/*.spec.tsx',
'./jest/setup.ts',
'./cypress/**',
'./analyzeTest.ts',
],
optionalDependencies: false,
peerDependencies: false,
bundledDependencies: false,
},
],
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'max-classes-per-file': 'off',
'max-len': 'off',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'no-empty-pattern': 'off',
'no-nested-ternary': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-prototype-builtins': 'off',
'no-redeclare': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': [
'error',
{ ignoreOnInitialization: true, allow: ['t'] },
],
'no-tabs': 'off',
'no-undef': 'off',
'no-underscore-dangle': 'off',
'no-unreachable': 'off',
'no-unsafe-optional-chaining': 'off',
'no-unused-expressions': 'off',
'no-use-before-define': 'off',
'no-useless-catch': 'off',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'operator-linebreak': 'off',
'prefer-destructuring': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-no-bind': 'off',
'react/jsx-pascal-case': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-array-index-key': 'off',
'react/no-unused-state': 'off',
'react/require-default-props': 'off',
'react/sort-comp': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'react/function-component-definition': [
2,
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'import/no-unresolved': 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'react/prop-types': 'off',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
],
pathGroups: [
{
pattern: 'react',
group: 'builtin',
position: 'before',
},
{
pattern: '@patternfly/*',
group: 'external',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin', 'react'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'never',
},
],
quotes: 'off',
indent: 'off',
curly: 'off',
camelcase: 'off',
},
settings: {
react: {
version: 'detect',
},
},
root: true,
};