@kouts/eslint-config 3.1.5 → 3.1.7

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.
package/dist/index.js CHANGED
@@ -1,612 +1,13 @@
1
1
  import js from '@eslint/js';
2
2
  import pluginHtml from 'eslint-plugin-html';
3
+ import importX from 'eslint-plugin-import-x';
3
4
  import pluginPrettier from 'eslint-plugin-prettier/recommended';
4
5
  import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
5
- import { readFileSync } from 'node:fs';
6
- import { join, dirname } from 'node:path';
7
- import { gitignoreToMinimatch } from '@humanwhocodes/gitignore-to-minimatch';
8
- import stylistic from '@stylistic/eslint-plugin';
9
- import importX from 'eslint-plugin-import-x';
10
- import pluginN from 'eslint-plugin-n';
11
- import pluginPromise from 'eslint-plugin-promise';
12
- import { findUpSync } from 'find-up';
13
- import globals from 'globals';
14
- import tseslint from 'typescript-eslint';
6
+ import neostandard, { plugins, resolveIgnoresFromGitignore } from 'neostandard';
7
+ export { plugins } from 'neostandard';
15
8
  import pluginVitest from '@vitest/eslint-plugin';
16
9
  import pluginVue from 'eslint-plugin-vue';
17
10
 
18
- const plugins = {
19
- "@stylistic": stylistic,
20
- "import-x": importX,
21
- n: pluginN,
22
- promise: pluginPromise,
23
- // react: pluginReact,
24
- "typescript-eslint": tseslint
25
- };
26
- const base = {
27
- name: "neostandard/base",
28
- languageOptions: {
29
- ecmaVersion: 2022,
30
- sourceType: "module",
31
- globals: {
32
- ...globals.es2022,
33
- ...globals.node,
34
- document: "readonly",
35
- navigator: "readonly",
36
- window: "readonly"
37
- }
38
- },
39
- plugins: {
40
- n: plugins.n
41
- },
42
- rules: {
43
- "no-var": "warn",
44
- "object-shorthand": ["warn", "properties"],
45
- "accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
46
- "array-callback-return": [
47
- "error",
48
- {
49
- allowImplicit: false,
50
- checkForEach: false
51
- }
52
- ],
53
- camelcase: [
54
- "error",
55
- {
56
- allow: ["^UNSAFE_"],
57
- properties: "never",
58
- ignoreGlobals: true
59
- }
60
- ],
61
- "constructor-super": "error",
62
- curly: ["error", "multi-line"],
63
- "default-case-last": "error",
64
- "dot-notation": ["error", { allowKeywords: true }],
65
- eqeqeq: ["error", "always", { null: "ignore" }],
66
- "new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
67
- "no-array-constructor": "error",
68
- "no-async-promise-executor": "error",
69
- "no-caller": "error",
70
- "no-case-declarations": "error",
71
- "no-class-assign": "error",
72
- "no-compare-neg-zero": "error",
73
- "no-cond-assign": "error",
74
- "no-const-assign": "error",
75
- "no-constant-condition": ["error", { checkLoops: false }],
76
- "no-control-regex": "error",
77
- "no-debugger": "error",
78
- "no-delete-var": "error",
79
- "no-dupe-args": "error",
80
- "no-dupe-class-members": "error",
81
- "no-dupe-keys": "error",
82
- "no-duplicate-case": "error",
83
- "no-useless-backreference": "error",
84
- "no-empty": ["error", { allowEmptyCatch: true }],
85
- "no-empty-character-class": "error",
86
- "no-empty-pattern": "error",
87
- "no-eval": "error",
88
- "no-ex-assign": "error",
89
- "no-extend-native": "error",
90
- "no-extra-bind": "error",
91
- "no-extra-boolean-cast": "error",
92
- "no-fallthrough": "error",
93
- "no-func-assign": "error",
94
- "no-global-assign": "error",
95
- "no-implied-eval": "error",
96
- "no-import-assign": "error",
97
- "no-invalid-regexp": "error",
98
- "no-irregular-whitespace": "error",
99
- "no-iterator": "error",
100
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
101
- "no-lone-blocks": "error",
102
- "no-loss-of-precision": "error",
103
- "no-misleading-character-class": "error",
104
- "no-prototype-builtins": "error",
105
- "no-useless-catch": "error",
106
- "no-multi-str": "error",
107
- "no-new": "error",
108
- "no-new-func": "error",
109
- "no-object-constructor": "error",
110
- "no-new-native-nonconstructor": "error",
111
- "no-new-wrappers": "error",
112
- "no-obj-calls": "error",
113
- "no-octal": "error",
114
- "no-octal-escape": "error",
115
- "no-proto": "error",
116
- "no-redeclare": ["error", { builtinGlobals: false }],
117
- "no-regex-spaces": "error",
118
- "no-return-assign": ["error", "except-parens"],
119
- "no-self-assign": ["error", { props: true }],
120
- "no-self-compare": "error",
121
- "no-sequences": "error",
122
- "no-shadow-restricted-names": "error",
123
- "no-sparse-arrays": "error",
124
- "no-template-curly-in-string": "error",
125
- "no-this-before-super": "error",
126
- "no-throw-literal": "error",
127
- "no-undef": "error",
128
- "no-undef-init": "error",
129
- "no-unexpected-multiline": "error",
130
- "no-unmodified-loop-condition": "error",
131
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
132
- "no-unreachable": "error",
133
- "no-unreachable-loop": "error",
134
- "no-unsafe-finally": "error",
135
- "no-unsafe-negation": "error",
136
- "no-unused-expressions": [
137
- "error",
138
- {
139
- allowShortCircuit: true,
140
- allowTernary: true,
141
- allowTaggedTemplates: true
142
- }
143
- ],
144
- "no-unused-vars": [
145
- "error",
146
- {
147
- args: "none",
148
- caughtErrors: "none",
149
- ignoreRestSiblings: true,
150
- vars: "all"
151
- }
152
- ],
153
- "no-use-before-define": ["error", { functions: false, classes: false, variables: false }],
154
- "no-useless-call": "error",
155
- "no-useless-computed-key": "error",
156
- "no-useless-constructor": "error",
157
- "no-useless-escape": "error",
158
- "no-useless-rename": "error",
159
- "no-useless-return": "error",
160
- "no-void": "error",
161
- "no-with": "error",
162
- "one-var": ["error", { initialized: "never" }],
163
- "prefer-const": ["error", { destructuring: "all" }],
164
- "prefer-promise-reject-errors": "error",
165
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
166
- "symbol-description": "error",
167
- "unicode-bom": ["error", "never"],
168
- "use-isnan": [
169
- "error",
170
- {
171
- enforceForSwitchCase: true,
172
- enforceForIndexOf: true
173
- }
174
- ],
175
- "valid-typeof": ["error", { requireStringLiterals: true }],
176
- yoda: ["error", "never"],
177
- "n/handle-callback-err": ["error", "^(err|error)$"],
178
- "n/no-callback-literal": "error",
179
- "n/no-deprecated-api": "error",
180
- "n/no-exports-assign": "error",
181
- "n/no-new-require": "error",
182
- "n/no-path-concat": "error",
183
- "n/process-exit-as-throw": "error",
184
- "promise/param-names": "error"
185
- }
186
- };
187
- const modernization = {
188
- name: "neostandard/modernization-since-standard-17",
189
- rules: {
190
- "dot-notation": "off",
191
- "n/no-deprecated-api": "warn"
192
- }
193
- };
194
- const promiseConfigs = [pluginPromise.configs["flat/recommended"]];
195
- const modernizationStyles = {
196
- name: "neostandard/style/modernization-since-standard-17",
197
- rules: {
198
- "@stylistic/comma-dangle": [
199
- "warn",
200
- {
201
- arrays: "ignore",
202
- enums: "ignore",
203
- exports: "ignore",
204
- imports: "ignore",
205
- objects: "ignore"
206
- }
207
- ],
208
- "@stylistic/no-multi-spaces": ["error", { ignoreEOLComments: true }]
209
- }
210
- };
211
- const style = {
212
- name: "neostandard/style",
213
- plugins: {
214
- "@stylistic": plugins["@stylistic"]
215
- },
216
- rules: {
217
- "@stylistic/array-bracket-spacing": ["error", "never"],
218
- "@stylistic/arrow-spacing": ["error", { before: true, after: true }],
219
- "@stylistic/block-spacing": ["error", "always"],
220
- "@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }],
221
- "@stylistic/comma-dangle": [
222
- "error",
223
- {
224
- arrays: "never",
225
- objects: "never",
226
- imports: "never",
227
- exports: "never",
228
- functions: "never"
229
- }
230
- ],
231
- "@stylistic/comma-spacing": ["error", { before: false, after: true }],
232
- "@stylistic/comma-style": ["error", "last"],
233
- "@stylistic/computed-property-spacing": ["error", "never", { enforceForClassMembers: true }],
234
- "@stylistic/dot-location": ["error", "property"],
235
- "@stylistic/eol-last": "error",
236
- "@stylistic/function-call-spacing": ["error", "never"],
237
- "@stylistic/generator-star-spacing": ["error", { before: true, after: true }],
238
- "@stylistic/indent": [
239
- "error",
240
- 2,
241
- {
242
- SwitchCase: 1,
243
- VariableDeclarator: 1,
244
- outerIIFEBody: 1,
245
- MemberExpression: 1,
246
- FunctionDeclaration: { parameters: 1, body: 1 },
247
- FunctionExpression: { parameters: 1, body: 1 },
248
- CallExpression: { arguments: 1 },
249
- ArrayExpression: 1,
250
- ObjectExpression: 1,
251
- ImportDeclaration: 1,
252
- flatTernaryExpressions: false,
253
- ignoreComments: false,
254
- ignoredNodes: ["TemplateLiteral *"],
255
- offsetTernaryExpressions: { CallExpression: false, AwaitExpression: false, NewExpression: false }
256
- }
257
- ],
258
- "@stylistic/key-spacing": ["error", { beforeColon: false, afterColon: true }],
259
- "@stylistic/keyword-spacing": ["error", { before: true, after: true }],
260
- "@stylistic/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
261
- "@stylistic/multiline-ternary": ["error", "always-multiline"],
262
- "@stylistic/new-parens": "error",
263
- "@stylistic/no-extra-parens": ["error", "functions"],
264
- "@stylistic/no-floating-decimal": "error",
265
- "@stylistic/no-mixed-operators": [
266
- "error",
267
- {
268
- groups: [
269
- ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
270
- ["&&", "||"],
271
- ["in", "instanceof"]
272
- ],
273
- allowSamePrecedence: true
274
- }
275
- ],
276
- "@stylistic/no-mixed-spaces-and-tabs": "error",
277
- "@stylistic/no-multi-spaces": "error",
278
- "@stylistic/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
279
- "@stylistic/no-tabs": "error",
280
- "@stylistic/no-trailing-spaces": "error",
281
- "@stylistic/no-whitespace-before-property": "error",
282
- "@stylistic/object-curly-newline": ["error", { multiline: true, consistent: true }],
283
- "@stylistic/object-curly-spacing": ["error", "always"],
284
- "@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
285
- "@stylistic/operator-linebreak": ["error", "after", { overrides: { "?": "before", ":": "before", "|>": "before" } }],
286
- "@stylistic/padded-blocks": ["error", { blocks: "never", switches: "never", classes: "never" }],
287
- "@stylistic/quote-props": ["error", "as-needed"],
288
- "@stylistic/quotes": ["error", "single", { avoidEscape: true, allowTemplateLiterals: "never" }],
289
- "@stylistic/rest-spread-spacing": ["error", "never"],
290
- "@stylistic/semi": ["error", "never"],
291
- "@stylistic/semi-spacing": ["error", { before: false, after: true }],
292
- "@stylistic/space-before-blocks": ["error", "always"],
293
- "@stylistic/space-before-function-paren": ["error", "always"],
294
- "@stylistic/space-in-parens": ["error", "never"],
295
- "@stylistic/space-infix-ops": "error",
296
- "@stylistic/space-unary-ops": ["error", { words: true, nonwords: false }],
297
- "@stylistic/spaced-comment": [
298
- "error",
299
- "always",
300
- {
301
- line: { markers: ["*package", "!", "/", ",", "="] },
302
- block: { balanced: true, markers: ["*package", "!", ",", ":", "::", "flow-include"], exceptions: ["*"] }
303
- }
304
- ],
305
- "@stylistic/template-curly-spacing": ["error", "never"],
306
- "@stylistic/template-tag-spacing": ["error", "never"],
307
- "@stylistic/wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
308
- "@stylistic/yield-star-spacing": ["error", "both"]
309
- }
310
- };
311
- const jsxIgnores = ["**/*.js", "**/*.mjs", "**/*.cjs", "**/*.ts"];
312
- const jsx = {
313
- name: "neostandard/jsx",
314
- ignores: [...jsxIgnores],
315
- languageOptions: {
316
- parserOptions: {
317
- ecmaFeatures: {
318
- jsx: true
319
- }
320
- }
321
- }
322
- /*
323
- * React support is temporarily disabled.
324
- * plugins: {
325
- * react: plugins.react,
326
- * },
327
- * settings: {
328
- * react: {
329
- * version: '17',
330
- * },
331
- * linkComponents: ['Link'],
332
- * },
333
- * rules: {
334
- * 'react/jsx-boolean-value': 'error',
335
- * 'react/jsx-fragments': ['error', 'syntax'],
336
- * 'react/jsx-handler-names': 'error',
337
- * 'react/jsx-key': [
338
- * 'error',
339
- * {
340
- * checkFragmentShorthand: true,
341
- * },
342
- * ],
343
- * 'react/jsx-no-comment-textnodes': 'error',
344
- * 'react/jsx-no-duplicate-props': 'error',
345
- * 'react/jsx-no-target-blank': ['error', { enforceDynamicLinks: 'always' }],
346
- * 'react/jsx-no-undef': ['error', { allowGlobals: true }],
347
- * 'react/jsx-uses-react': 'error',
348
- * 'react/jsx-uses-vars': 'error',
349
- * 'react/no-children-prop': 'error',
350
- * 'react/no-danger-with-children': 'error',
351
- * 'react/no-deprecated': 'error',
352
- * 'react/no-direct-mutation-state': 'error',
353
- * 'react/no-find-dom-node': 'error',
354
- * 'react/no-is-mounted': 'error',
355
- * 'react/no-string-refs': [
356
- * 'error',
357
- * {
358
- * noTemplateLiterals: true,
359
- * },
360
- * ],
361
- * 'react/no-unescaped-entities': [
362
- * 'error',
363
- * {
364
- * forbid: ['>', '}'],
365
- * },
366
- * ],
367
- * 'react/no-render-return-value': 'error',
368
- * 'react/require-render-return': 'error',
369
- * 'react/self-closing-comp': 'error',
370
- * },
371
- */
372
- };
373
- const jsxStyles = {
374
- name: "neostandard/style/jsx",
375
- ignores: [...jsxIgnores],
376
- rules: {
377
- "@stylistic/jsx-quotes": ["error", "prefer-single"],
378
- "@stylistic/jsx-closing-bracket-location": ["error", "tag-aligned"],
379
- "@stylistic/jsx-closing-tag-location": "error",
380
- "@stylistic/jsx-curly-brace-presence": [
381
- "error",
382
- {
383
- props: "never",
384
- children: "never"
385
- }
386
- ],
387
- "@stylistic/jsx-curly-newline": [
388
- "error",
389
- {
390
- multiline: "consistent",
391
- singleline: "consistent"
392
- }
393
- ],
394
- "@stylistic/jsx-curly-spacing": [
395
- "error",
396
- {
397
- attributes: { when: "never", allowMultiline: true },
398
- children: { when: "never", allowMultiline: true }
399
- }
400
- ],
401
- "@stylistic/jsx-equals-spacing": ["error", "never"],
402
- "@stylistic/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
403
- "@stylistic/jsx-pascal-case": ["error", { allowAllCaps: false }],
404
- "@stylistic/jsx-props-no-multi-spaces": "error",
405
- "@stylistic/jsx-tag-spacing": [
406
- "error",
407
- {
408
- closingSlash: "never",
409
- beforeSelfClosing: "always",
410
- afterOpening: "never",
411
- beforeClosing: "never"
412
- }
413
- ],
414
- "@stylistic/jsx-wrap-multilines": [
415
- "error",
416
- {
417
- declaration: "parens-new-line",
418
- assignment: "parens-new-line",
419
- return: "parens-new-line",
420
- arrow: "ignore",
421
- condition: "ignore",
422
- logical: "ignore",
423
- prop: "ignore"
424
- }
425
- ]
426
- }
427
- };
428
- const semiConfig = {
429
- name: "neostandard/semi",
430
- rules: {
431
- "@stylistic/semi": ["error", "always"],
432
- "@stylistic/no-extra-semi": "error"
433
- }
434
- };
435
- const jsImportRules = {
436
- name: "neostandard/import-x",
437
- files: ["**/*.js", "**/*.mjs", "**/*.cjs", "**/*.jsx"],
438
- plugins: {
439
- "import-x": plugins["import-x"]
440
- },
441
- rules: {
442
- "import-x/export": "error",
443
- "import-x/first": "error",
444
- "import-x/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
445
- "import-x/no-duplicates": "error",
446
- "import-x/no-named-default": "error",
447
- "import-x/no-webpack-loader-syntax": "error",
448
- // Custom rules
449
- "import-x/no-mutable-exports": "error",
450
- "import-x/newline-after-import": ["error", { count: 1 }],
451
- "import-x/no-self-import": "error"
452
- }
453
- };
454
- const isNonEmpty = (value) => Object.keys(value).length > 0;
455
- const resolveIgnoresFromGitignore = () => {
456
- const configFile = findFlatConfigFileSync();
457
- if (!configFile) {
458
- return [];
459
- }
460
- const result = [];
461
- try {
462
- const content = readFileSync(join(dirname(configFile), ".gitignore"), "utf8");
463
- for (let line of content.split("\n")) {
464
- line = line.trim();
465
- if (line && !line.startsWith("#")) {
466
- result.push(gitignoreToMinimatch(line));
467
- }
468
- }
469
- } catch {
470
- }
471
- return result;
472
- };
473
- function findFlatConfigFileSync() {
474
- return findUpSync([
475
- "eslint.config.js",
476
- "eslint.config.mjs",
477
- "eslint.config.cjs",
478
- "eslint.config.ts",
479
- "eslint.config.mts",
480
- "eslint.config.cts"
481
- ]);
482
- }
483
- function typescriptify(configs, options) {
484
- const { files, ignores, name, project, tsconfigRootDir, typeChecking = false } = options;
485
- const deactivatedRules = {};
486
- const replacementRules = {};
487
- const tsPlugin = tseslint.plugin;
488
- for (const config of configs) {
489
- for (const ruleId of Object.keys(tsRedundant)) {
490
- if (config.rules?.[ruleId]) {
491
- deactivatedRules[ruleId] = "off";
492
- }
493
- }
494
- for (const [ruleId, ruleDefinition] of Object.entries(tsPlugin.rules)) {
495
- const currentRule = config.rules?.[ruleId];
496
- if (currentRule === void 0) {
497
- continue;
498
- }
499
- if (!ruleDefinition.meta?.docs || typeof ruleDefinition.meta.docs !== "object") {
500
- continue;
501
- }
502
- const docs = ruleDefinition.meta.docs;
503
- if (!docs.extendsBaseRule) {
504
- continue;
505
- }
506
- if (docs.requiresTypeChecking && !typeChecking) {
507
- continue;
508
- }
509
- deactivatedRules[ruleId] = "off";
510
- if (ruleId !== "dot-notation") {
511
- replacementRules[`@typescript-eslint/${ruleId}`] = currentRule;
512
- }
513
- }
514
- }
515
- return {
516
- ...name ? { name } : {},
517
- ...files ? { files } : {},
518
- ...ignores ? { ignores } : {},
519
- languageOptions: {
520
- parser: tseslint.parser,
521
- parserOptions: {
522
- project: project === void 0 ? typeChecking : project,
523
- ...tsconfigRootDir ? { tsconfigRootDir } : {}
524
- }
525
- },
526
- plugins: {
527
- "@typescript-eslint": tseslint.plugin
528
- },
529
- rules: {
530
- ...deactivatedRules,
531
- ...replacementRules
532
- }
533
- };
534
- }
535
- const tsRedundant = {
536
- "getter-return": "off",
537
- "constructor-super": "off",
538
- "no-const-assign": "off",
539
- "no-dupe-args": "off",
540
- "no-dupe-class-members": "off",
541
- "no-dupe-keys": "off",
542
- "no-func-assign": "off",
543
- "no-import-assign": "off",
544
- "no-new-native-nonconstructor": "off",
545
- "no-obj-calls": "off",
546
- "no-redeclare": "off",
547
- "no-setter-return": "off",
548
- "no-this-before-super": "off",
549
- "no-undef": "off",
550
- "no-unreachable": "off",
551
- "no-unsafe-negation": "off"
552
- };
553
- const getJsConfigs = (opts) => {
554
- const jsxConfigs = opts.noJsx ? [] : [jsx, ...opts.noStyle ? [] : [jsxStyles]];
555
- const styleConfigs = opts.noStyle ? [] : [style, modernizationStyles, ...opts.semi ? [semiConfig] : []];
556
- return [...promiseConfigs, base, modernization, ...jsxConfigs, ...styleConfigs, jsImportRules];
557
- };
558
- const neostandard = (options) => {
559
- const {
560
- env,
561
- files: rawFiles,
562
- filesTs,
563
- globals: rawGlobals,
564
- ignores,
565
- noJsx = false,
566
- noStyle = false,
567
- ts = false,
568
- semi = false
569
- } = options || {};
570
- if (filesTs && !ts) {
571
- throw new Error('"filesTs" is only usable with the "ts" option');
572
- }
573
- const resolvedGlobals = Array.isArray(rawGlobals) ? Object.fromEntries(rawGlobals.map((global) => [global, true])) : { ...rawGlobals };
574
- for (const key of env || []) {
575
- if (!globals[key]) {
576
- throw new Error(`Invalid env definition: ${env}`);
577
- }
578
- const envGlobals = globals[key];
579
- for (const [name, value] of Object.entries(envGlobals)) {
580
- resolvedGlobals[name] = resolvedGlobals[name] || value;
581
- }
582
- }
583
- const files = [...rawFiles || [], ...noJsx ? [] : ["**/*.jsx"]];
584
- const jsConfigs = getJsConfigs({ noJsx, noStyle, semi });
585
- return [
586
- ...ignores ? [{ ignores }] : [],
587
- ...files.length ? [
588
- {
589
- name: "neostandard/additional-files",
590
- files
591
- }
592
- ] : [],
593
- ...isNonEmpty(resolvedGlobals) ? [
594
- {
595
- name: "neostandard/globals",
596
- languageOptions: { globals: resolvedGlobals }
597
- }
598
- ] : [],
599
- ...jsConfigs,
600
- ...ts ? [
601
- typescriptify(jsConfigs, {
602
- files: ["**/*.ts", ...noJsx ? [] : ["**/*.tsx"], ...filesTs || []],
603
- ignores: [...ignores || [], "**/*.md/**"],
604
- name: "neostandard/ts"
605
- })
606
- ] : []
607
- ];
608
- };
609
-
610
11
  const rule = {
611
12
  meta: {
612
13
  type: "suggestion",
@@ -787,6 +188,8 @@ const vue = (options) => {
787
188
  };
788
189
 
789
190
  const customRulesPlugin = { name: "kouts", rules: customRules };
191
+ const defaultEnvironments = ["node", "browser"];
192
+ const defaultFiles = ["**/*.vue"];
790
193
  const config = (options) => {
791
194
  const opts = {
792
195
  noJsx: true,
@@ -796,7 +199,9 @@ const config = (options) => {
796
199
  vue: true,
797
200
  vueVersion: 3,
798
201
  vitest: true,
799
- ...options
202
+ ...options,
203
+ env: [.../* @__PURE__ */ new Set([...defaultEnvironments, ...options?.env || []])],
204
+ files: [.../* @__PURE__ */ new Set([...defaultFiles, ...options?.files || []])]
800
205
  };
801
206
  const linterConfig = [
802
207
  // Custom rules plugin
@@ -827,6 +232,24 @@ const config = (options) => {
827
232
  ...opts.ts ? typescript : [],
828
233
  // Neostandard
829
234
  ...neostandard(opts),
235
+ {
236
+ name: "kouts/import-x",
237
+ files: ["**/*.js", "**/*.mjs", "**/*.cjs", "**/*.jsx"],
238
+ plugins: {
239
+ "import-x": importX
240
+ },
241
+ rules: {
242
+ "import-x/export": "error",
243
+ "import-x/first": "error",
244
+ "import-x/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
245
+ "import-x/no-duplicates": "error",
246
+ "import-x/no-named-default": "error",
247
+ "import-x/no-webpack-loader-syntax": "error",
248
+ "import-x/no-mutable-exports": "error",
249
+ "import-x/newline-after-import": ["error", { count: 1 }],
250
+ "import-x/no-self-import": "error"
251
+ }
252
+ },
830
253
  {
831
254
  name: "kouts/neostandard-overrides",
832
255
  rules: {
@@ -884,4 +307,4 @@ const config = (options) => {
884
307
  return linterConfig;
885
308
  };
886
309
 
887
- export { config, plugins };
310
+ export { config };