@alexlit/config-eslint 90.0.0 → 91.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +14 -29
  2. package/index.js +44 -8
  3. package/package.json +11 -53
  4. package/constants/allow-boolean-property-list.js +0 -38
  5. package/constants/boolean-prefixes.js +0 -11
  6. package/constants/english-verbs.js +0 -3368
  7. package/dictionaries/index.js +0 -467
  8. package/dictionaries/programming/bash.js +0 -25
  9. package/dictionaries/programming/django.js +0 -2345
  10. package/dictionaries/programming/elixir.js +0 -64
  11. package/dictionaries/programming/go.js +0 -7748
  12. package/dictionaries/programming/java.js +0 -33527
  13. package/dictionaries/programming/latex.js +0 -675
  14. package/dictionaries/programming/lua.js +0 -394
  15. package/dictionaries/programming/php.js +0 -9788
  16. package/dictionaries/programming/python.js +0 -367
  17. package/dictionaries/programming/ruby.js +0 -357
  18. package/dictionaries/programming/rust.js +0 -115
  19. package/dictionaries/programming/scala.js +0 -2755
  20. package/dictionaries/specialized/html-symbol-entities.js +0 -1118
  21. package/dictionaries/specialized/lorem-ipsum.js +0 -359
  22. package/legacy.js +0 -3
  23. package/plugins/array-func.js +0 -20
  24. package/plugins/compat.js +0 -7
  25. package/plugins/decorator-position.js +0 -15
  26. package/plugins/eslint-comments.js +0 -9
  27. package/plugins/etc.js +0 -13
  28. package/plugins/ext.js +0 -12
  29. package/plugins/filenames.js +0 -38
  30. package/plugins/import.js +0 -133
  31. package/plugins/jsdoc.js +0 -32
  32. package/plugins/jsx-a11y.js +0 -5
  33. package/plugins/lit-a11y.js +0 -5
  34. package/plugins/lit.js +0 -9
  35. package/plugins/more.js +0 -17
  36. package/plugins/no-await-in-promise.js +0 -5
  37. package/plugins/no-constructor-bind.js +0 -8
  38. package/plugins/no-explicit-type-exports.js +0 -7
  39. package/plugins/no-loops.js +0 -7
  40. package/plugins/no-secrets.js +0 -12
  41. package/plugins/no-use-extend-native.js +0 -5
  42. package/plugins/node.js +0 -5
  43. package/plugins/prettier.js +0 -24
  44. package/plugins/promise.js +0 -10
  45. package/plugins/regexp.js +0 -7
  46. package/plugins/security.js +0 -10
  47. package/plugins/simple-import-sort.js +0 -7
  48. package/plugins/sonar.js +0 -5
  49. package/plugins/sort-class-members.js +0 -298
  50. package/plugins/sort-destructure-keys.js +0 -10
  51. package/plugins/sort-keys-fix.js +0 -7
  52. package/plugins/spellcheck.js +0 -9
  53. package/plugins/sql.js +0 -26
  54. package/plugins/tanstack-query.js +0 -4
  55. package/plugins/testing-library.js +0 -9
  56. package/plugins/typescript-sort-keys.js +0 -5
  57. package/plugins/typescript.js +0 -157
  58. package/plugins/unicorn.js +0 -70
  59. package/plugins/unused-imports.js +0 -17
  60. package/plugins/vitest.js +0 -16
  61. package/plugins/vue-i18n.js +0 -34
  62. package/plugins/vue.js +0 -291
  63. package/plugins/vuejs-accessibility.js +0 -20
  64. package/plugins/wc.js +0 -5
  65. package/plugins/write-good-comments.js +0 -7
  66. package/utils/create-config.js +0 -377
  67. package/utils/extend-spell-checker.js +0 -23
@@ -1,377 +0,0 @@
1
- /* eslint-disable sonarjs/no-duplicate-string, import/order, no-undef */
2
-
3
- const { defineConfig } = require('eslint-define-config');
4
-
5
- const DEFAULT_PLUGINS = {
6
- /** @see [eslint-plugin-decorator-position](https://github.com/NullVoxPopuli/eslint-plugin-decorator-position) */
7
- 'decorator-position': true,
8
-
9
- /**
10
- * @see [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import)
11
- * @see [eslint-import-resolver-alias](https://github.com/johvin/eslint-import-resolver-alias)
12
- */
13
- import: true,
14
-
15
- /** @see [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) */
16
- jsdoc: true,
17
-
18
- /** @see [eslint-plugin-regexp](https://github.com/ota-meshi/eslint-plugin-regexp) */
19
- regexp: true,
20
-
21
- /** @see [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort) */
22
- 'simple-import-sort': true,
23
-
24
- /** @see [eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs) */
25
- sonar: true,
26
-
27
- /** @see [eslint-plugin-sort-class-members](https://github.com/bryanrsmith/eslint-plugin-sort-class-members) */
28
- 'sort-class-members': true,
29
-
30
- /** @see [eslint-plugin-sort-destructure-keys](https://github.com/mthadley/eslint-plugin-sort-destructure-keys) */
31
- 'sort-destructure-keys': true,
32
-
33
- /** @see [eslint-plugin-sort-keys-fix](https://github.com/leo-buneev/eslint-plugin-sort-keys-fix) */
34
- 'sort-keys-fix': true,
35
-
36
- /** @see [@tanstack/query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query) */
37
- 'tanstack-query': true,
38
-
39
- /** @see [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library) */
40
- 'testing-library': true,
41
-
42
- /** @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) */
43
- typescript: true,
44
-
45
- /** @see [eslint-plugin-typescript-sort-keys](https://github.com/infctr/eslint-plugin-typescript-sort-keys) */
46
- 'typescript-sort-keys': true,
47
-
48
- /** @see [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) */
49
- unicorn: true,
50
-
51
- /** @see [eslint-plugin-unused-imports](https://github.com/sweepline/eslint-plugin-unused-imports) */
52
- 'unused-imports': true,
53
-
54
- /** @see [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) */
55
- vitest: true,
56
-
57
- /** @see [eslint-plugin-vue](https://eslint.vuejs.org/rules/) */
58
- vue: true,
59
-
60
- /** @see [eslint-plugin-vue-i18n](https://eslint-plugin-vue-i18n.intlify.dev/) */
61
- 'vue-i18n': true,
62
-
63
- /** @see [eslint-plugin-vuejs-accessibility](https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility) */
64
- 'vuejs-accessibility': true,
65
- };
66
-
67
- const OPTIONAL_PLUGINS = {
68
- /** @see [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func) */
69
- 'array-func': false,
70
-
71
- /** @see [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat) */
72
- compat: false,
73
-
74
- /** @see [eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments) */
75
- 'eslint-comments': false,
76
-
77
- /** @see [eslint-plugin-etc](https://github.com/cartant/eslint-plugin-etc) */
78
- etc: false,
79
-
80
- /** @see [eslint-plugin-ext](https://github.com/jiangfengming/eslint-plugin-ext) */
81
- ext: false,
82
-
83
- /** @see [eslint-plugin-filenames](https://github.com/selaux/eslint-plugin-filenames) */
84
- filenames: false,
85
-
86
- /** @see [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) */
87
- 'jsx-a11y': false,
88
-
89
- /** @see [eslint-plugin-lit](https://github.com/43081j/eslint-plugin-lit) */
90
- lit: false,
91
-
92
- /** @see [eslint-plugin-lit-a11y](https://www.npmjs.com/package/eslint-plugin-lit-a11y) */
93
- 'lit-a11y': false,
94
-
95
- /** @see [eslint-plugin-more](https://github.com/WebbyLab/eslint-plugin-more) */
96
- more: false,
97
-
98
- /** @see [eslint-plugin-no-await-in-promise](https://github.com/hugo-vrijswijk/eslint-plugin-no-await-in-promise/) */
99
- 'no-await-in-promise': false,
100
-
101
- /** @see [eslint-plugin-no-constructor-bind](https://github.com/markalfred/eslint-plugin-no-constructor-bind) */
102
- 'no-constructor-bind': false,
103
-
104
- /** @see [eslint-plugin-no-explicit-type-exports](https://github.com/intuit/eslint-plugin-no-explicit-type-exports) */
105
- 'no-explicit-type-exports': false,
106
-
107
- /** @see [eslint-plugin-no-loops](https://github.com/buildo/eslint-plugin-no-loops) */
108
- 'no-loops': false,
109
-
110
- /** @see [eslint-plugin-no-secrets](https://github.com/nickdeis/eslint-plugin-no-secrets) */
111
- 'no-secrets': false,
112
-
113
- /** @see [eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native) */
114
- 'no-use-extend-native': false,
115
-
116
- /** @see [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) */
117
- node: false,
118
-
119
- /** @see [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) */
120
- promise: false,
121
-
122
- /** @see [eslint-plugin-security](https://github.com/nodesecurity/eslint-plugin-security) */
123
- security: false,
124
-
125
- /** @see [eslint-plugin-spellcheck](https://github.com/aotaduy/eslint-plugin-spellcheck) */
126
- spellcheck: false,
127
-
128
- /** @see [eslint-plugin-sql](https://github.com/gajus/eslint-plugin-sql) */
129
- sql: false,
130
-
131
- /** @see [eslint-plugin-wc](https://github.com/43081j/eslint-plugin-wc) */
132
- wc: false,
133
-
134
- /** @see [eslint-plugin-write-good-comments](https://github.com/kantord/eslint-plugin-write-good-comments) */
135
- 'write-good-comments': false,
136
- };
137
-
138
- const CODESTYLE_PLUGINS = {
139
- /** @see [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) */
140
- prettier: true,
141
- };
142
-
143
- const PLUGINS = {
144
- ...DEFAULT_PLUGINS,
145
- ...OPTIONAL_PLUGINS,
146
- ...CODESTYLE_PLUGINS,
147
- };
148
-
149
- /**
150
- * Create "extends" field
151
- *
152
- * @param {PLUGINS} plugins Enabled/disabled plugins list
153
- */
154
- const createPluginsList = (plugins = {}) => {
155
- const pluginsList = [];
156
-
157
- Object.entries({ ...PLUGINS, ...plugins })?.forEach(([name, isActive]) => {
158
- if (isActive) {
159
- pluginsList.push(require.resolve(`../plugins/${name}`));
160
- }
161
- });
162
-
163
- return pluginsList;
164
- };
165
-
166
- /**
167
- * Create eslint config
168
- *
169
- * @param {PLUGINS} plugins Enabled/disabled plugins list
170
- * @param {import('eslint-define-config').defineConfig} options Eslint options
171
- */
172
- const createConfig = (plugins = {}, options = {}) =>
173
- defineConfig({
174
- ...options,
175
-
176
- env: {
177
- browser: true,
178
- node: true,
179
-
180
- ...options.env,
181
- },
182
-
183
- extends: [
184
- /** @see [eslint-config-airbnb-base](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) */
185
- 'airbnb-base',
186
-
187
- ...createPluginsList(plugins),
188
-
189
- ...(options.extends ?? []),
190
- ],
191
-
192
- ignorePatterns: [
193
- 'build',
194
- 'dist',
195
- 'docs',
196
- 'node_modules',
197
- 'storybook-*',
198
- 'sw.js',
199
- '!.*.js',
200
- '!.node',
201
- '!.storybook',
202
-
203
- ...(options.ignorePatterns ?? []),
204
- ],
205
-
206
- overrides: [
207
- {
208
- files: ['.*.cjs', '.*.js'],
209
-
210
- rules: {
211
- 'global-require': 'off',
212
- },
213
- },
214
- {
215
- files: ['**/store/**/*', '**/vuex/**/*', '**/pinia/**/*'],
216
-
217
- rules: {
218
- 'no-param-reassign': 'off',
219
- },
220
- },
221
-
222
- ...(options.overrides ?? []),
223
- ],
224
-
225
- parserOptions: {
226
- ecmaFeatures: { jsx: true },
227
- extraFileExtensions: ['.vue'],
228
- parser: '@typescript-eslint/parser',
229
- project: ['./tsconfig.json'],
230
-
231
- ...options.parserOptions,
232
- },
233
-
234
- root: options.root ?? true,
235
-
236
- rules: {
237
- 'class-methods-use-this': 'off',
238
- curly: 'error',
239
- 'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
240
- 'grouped-accessor-pairs': ['error', 'getBeforeSet'],
241
- indent: 'off',
242
-
243
- 'lines-around-comment': [
244
- 'warn',
245
- {
246
- afterBlockComment: false,
247
- afterLineComment: false,
248
-
249
- allowArrayEnd: true,
250
- allowArrayStart: true,
251
-
252
- allowBlockEnd: true,
253
- allowBlockStart: true,
254
-
255
- allowClassEnd: true,
256
- allowClassStart: true,
257
-
258
- allowObjectEnd: true,
259
- allowObjectStart: true,
260
-
261
- beforeBlockComment: true,
262
- beforeLineComment: false,
263
- },
264
- ],
265
-
266
- 'no-console': 'warn',
267
-
268
- 'no-implicit-coercion': 'error',
269
-
270
- 'no-param-reassign': ['error', { props: false }],
271
-
272
- 'no-restricted-exports': [
273
- 'error',
274
- {
275
- restrictedNamedExports: [
276
- 'then', // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
277
- ],
278
- },
279
- ],
280
-
281
- 'no-restricted-imports': [
282
- 'error',
283
- {
284
- patterns: [
285
- {
286
- group: ['.', '..', '*/..'],
287
- message: 'Use absolute path instead',
288
- },
289
- ],
290
- },
291
- ],
292
-
293
- 'no-return-await': 'off',
294
-
295
- 'no-shadow': 'off',
296
-
297
- 'no-underscore-dangle': 'off',
298
-
299
- 'no-unused-vars': 'off',
300
-
301
- // delegate to eslint-plugin-unused-imports
302
- 'no-use-before-define': 'off',
303
-
304
- 'nonblock-statement-body-position': ['error', 'below'],
305
-
306
- 'padding-line-between-statements': [
307
- 'warn',
308
- // always
309
- { blankLine: 'always', next: '*', prev: 'block-like' },
310
- { blankLine: 'always', next: '*', prev: 'case' },
311
- { blankLine: 'always', next: '*', prev: 'cjs-export' },
312
- { blankLine: 'always', next: '*', prev: 'cjs-import' },
313
- { blankLine: 'always', next: '*', prev: 'class' },
314
- { blankLine: 'always', next: '*', prev: 'default' },
315
- { blankLine: 'always', next: '*', prev: 'directive' },
316
- { blankLine: 'always', next: '*', prev: 'expression' },
317
- { blankLine: 'always', next: '*', prev: 'iife' },
318
- { blankLine: 'always', next: '*', prev: 'multiline-block-like' },
319
- { blankLine: 'always', next: '*', prev: 'multiline-const' },
320
- { blankLine: 'always', next: '*', prev: 'multiline-expression' },
321
- { blankLine: 'always', next: '*', prev: 'multiline-let' },
322
- { blankLine: 'always', next: '*', prev: 'multiline-var' },
323
- { blankLine: 'always', next: '*', prev: 'singleline-const' },
324
- { blankLine: 'always', next: '*', prev: 'singleline-let' },
325
- { blankLine: 'always', next: '*', prev: 'singleline-var' },
326
- { blankLine: 'always', next: 'block-like', prev: '*' },
327
- { blankLine: 'always', next: 'cjs-export', prev: '*' },
328
- { blankLine: 'always', next: 'cjs-import', prev: '*' },
329
- { blankLine: 'always', next: 'class', prev: '*' },
330
- { blankLine: 'always', next: 'expression', prev: '*' },
331
- { blankLine: 'always', next: 'function', prev: '*' },
332
- { blankLine: 'always', next: 'iife', prev: '*' },
333
- { blankLine: 'always', next: 'multiline-block-like', prev: '*' },
334
- { blankLine: 'always', next: 'multiline-const', prev: '*' },
335
- { blankLine: 'always', next: 'multiline-expression', prev: '*' },
336
- { blankLine: 'always', next: 'multiline-let', prev: '*' },
337
- { blankLine: 'always', next: 'multiline-var', prev: '*' },
338
- { blankLine: 'always', next: 'return', prev: '*' },
339
- { blankLine: 'always', next: 'switch', prev: '*' },
340
- // any
341
- { blankLine: 'any', next: 'expression', prev: 'expression' },
342
- {
343
- blankLine: 'any',
344
- next: 'singleline-const',
345
- prev: 'singleline-const',
346
- },
347
- { blankLine: 'any', next: 'singleline-let', prev: 'singleline-let' },
348
- { blankLine: 'any', next: 'singleline-var', prev: 'singleline-var' },
349
- // never
350
- { blankLine: 'never', next: 'cjs-export', prev: 'cjs-export' },
351
- { blankLine: 'never', next: 'cjs-import', prev: 'cjs-import' },
352
- { blankLine: 'never', next: 'directive', prev: 'directive' },
353
- ],
354
-
355
- quotes: ['error', 'single'],
356
- 'require-await': 'off',
357
-
358
- 'sort-imports': [
359
- 'warn',
360
- {
361
- allowSeparatedGroups: true,
362
- ignoreCase: true,
363
- ignoreDeclarationSort: true,
364
- ignoreMemberSort: false,
365
- memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
366
- },
367
- ],
368
-
369
- 'sort-keys': 'off', // delegate to sort-keys-fix
370
-
371
- 'sort-vars': 'warn',
372
-
373
- ...options.rules,
374
- },
375
- });
376
-
377
- module.exports = { createConfig };
@@ -1,23 +0,0 @@
1
- const dictionaries = require('../dictionaries');
2
-
3
- /**
4
- * Extends 'spellcheck/spell-checker' config
5
- *
6
- * @param {Record<string, any>} options 'spellcheck/spell-checker' options
7
- * @param {'warn' | 'error'} level 'spellcheck/spell-checker' warnings level
8
- */
9
- const extendSpellChecker = (options, level = 'warn') => [
10
- level,
11
- {
12
- ignoreRequire: true,
13
- minLength: 4,
14
- skipIfMatch: ['^@.*', '^plugin:.*'],
15
- skipWordIfMatch: [/^[\da-f]{3,6}$/, /^'/, /'$/],
16
-
17
- ...options,
18
-
19
- skipWords: [...dictionaries, ...(options?.skipWords ?? [])],
20
- },
21
- ];
22
-
23
- module.exports = { extendSpellChecker };