@jsse/eslint-config 0.0.1 → 0.0.2
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/LICENSE +21 -21
- package/README.md +18 -4
- package/dist/cli.cjs +661 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +655 -0
- package/dist/index.cjs +234 -214
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +57 -101
- package/package.json +7 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var eslintPlugin = require('@stylistic/eslint-plugin');
|
|
6
|
+
var default3 = require('@typescript-eslint/eslint-plugin');
|
|
7
|
+
var parserTs = require('@typescript-eslint/parser');
|
|
8
|
+
var default4 = require('eslint-plugin-eslint-comments');
|
|
9
|
+
var pluginImport = require('eslint-plugin-i');
|
|
10
|
+
var default5 = require('eslint-plugin-jsdoc');
|
|
11
|
+
var pluginJsonc = require('eslint-plugin-jsonc');
|
|
12
|
+
var default6 = require('eslint-plugin-n');
|
|
13
|
+
var default7 = require('eslint-plugin-no-only-tests');
|
|
14
|
+
var default8 = require('eslint-plugin-react');
|
|
15
|
+
var default9 = require('eslint-plugin-react-hooks');
|
|
16
|
+
var pluginReactRefresh = require('eslint-plugin-react-refresh');
|
|
17
|
+
var default10 = require('eslint-plugin-unicorn');
|
|
18
|
+
var default11 = require('eslint-plugin-unused-imports');
|
|
19
|
+
var default12 = require('eslint-plugin-tailwindcss');
|
|
20
|
+
var default13 = require('eslint-plugin-vitest');
|
|
21
|
+
var default14 = require('jsonc-eslint-parser');
|
|
22
|
+
var eslintPluginMarkdown = require('eslint-plugin-markdown');
|
|
23
|
+
var eslintjs = require('@eslint/js');
|
|
24
|
+
var globals = require('globals');
|
|
25
|
+
var process2 = require('process');
|
|
26
|
+
var fs = require('fs');
|
|
27
|
+
var gitignore = require('eslint-config-flat-gitignore');
|
|
28
|
+
var localPkg = require('local-pkg');
|
|
29
|
+
|
|
30
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
31
|
+
|
|
32
|
+
function _interopNamespace(e) {
|
|
33
|
+
if (e && e.__esModule) return e;
|
|
34
|
+
var n = Object.create(null);
|
|
35
|
+
if (e) {
|
|
36
|
+
Object.keys(e).forEach(function (k) {
|
|
37
|
+
if (k !== 'default') {
|
|
38
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
39
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return e[k]; }
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
n.default = e;
|
|
47
|
+
return Object.freeze(n);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var eslintPlugin__default = /*#__PURE__*/_interopDefault(eslintPlugin);
|
|
51
|
+
var default3__default = /*#__PURE__*/_interopDefault(default3);
|
|
52
|
+
var parserTs__namespace = /*#__PURE__*/_interopNamespace(parserTs);
|
|
53
|
+
var default4__default = /*#__PURE__*/_interopDefault(default4);
|
|
54
|
+
var pluginImport__namespace = /*#__PURE__*/_interopNamespace(pluginImport);
|
|
55
|
+
var default5__default = /*#__PURE__*/_interopDefault(default5);
|
|
56
|
+
var pluginJsonc__namespace = /*#__PURE__*/_interopNamespace(pluginJsonc);
|
|
57
|
+
var default6__default = /*#__PURE__*/_interopDefault(default6);
|
|
58
|
+
var default7__default = /*#__PURE__*/_interopDefault(default7);
|
|
59
|
+
var default8__default = /*#__PURE__*/_interopDefault(default8);
|
|
60
|
+
var default9__default = /*#__PURE__*/_interopDefault(default9);
|
|
61
|
+
var pluginReactRefresh__namespace = /*#__PURE__*/_interopNamespace(pluginReactRefresh);
|
|
62
|
+
var default10__default = /*#__PURE__*/_interopDefault(default10);
|
|
63
|
+
var default11__default = /*#__PURE__*/_interopDefault(default11);
|
|
64
|
+
var default12__default = /*#__PURE__*/_interopDefault(default12);
|
|
65
|
+
var default13__default = /*#__PURE__*/_interopDefault(default13);
|
|
66
|
+
var default14__default = /*#__PURE__*/_interopDefault(default14);
|
|
67
|
+
var eslintPluginMarkdown__default = /*#__PURE__*/_interopDefault(eslintPluginMarkdown);
|
|
68
|
+
var eslintjs__default = /*#__PURE__*/_interopDefault(eslintjs);
|
|
69
|
+
var globals__default = /*#__PURE__*/_interopDefault(globals);
|
|
70
|
+
var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
71
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
72
|
+
var gitignore__default = /*#__PURE__*/_interopDefault(gitignore);
|
|
73
|
+
|
|
2
74
|
var __create = Object.create;
|
|
3
75
|
var __defProp = Object.defineProperty;
|
|
4
76
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -8,10 +80,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
80
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
81
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
82
|
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
83
|
var __copyProps = (to, from, except, desc) => {
|
|
16
84
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
85
|
for (let key of __getOwnPropNames(from))
|
|
@@ -28,12 +96,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
96
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
97
|
mod
|
|
30
98
|
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
99
|
|
|
33
100
|
// node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js
|
|
34
101
|
var require_natural_compare = __commonJS({
|
|
35
|
-
"node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js"(exports,
|
|
36
|
-
"use strict";
|
|
102
|
+
"node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js"(exports, module) {
|
|
37
103
|
var naturalCompare = function(a, b) {
|
|
38
104
|
var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
|
|
39
105
|
function getCode(str, pos, code) {
|
|
@@ -60,7 +126,7 @@ var require_natural_compare = __commonJS({
|
|
|
60
126
|
return 0;
|
|
61
127
|
};
|
|
62
128
|
try {
|
|
63
|
-
|
|
129
|
+
module.exports = naturalCompare;
|
|
64
130
|
} catch (e) {
|
|
65
131
|
String.naturalCompare = naturalCompare;
|
|
66
132
|
}
|
|
@@ -69,10 +135,9 @@ var require_natural_compare = __commonJS({
|
|
|
69
135
|
|
|
70
136
|
// node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js
|
|
71
137
|
var require_sort_keys_fix = __commonJS({
|
|
72
|
-
"node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js"(exports,
|
|
73
|
-
"use strict";
|
|
138
|
+
"node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js"(exports, module) {
|
|
74
139
|
var naturalCompare = require_natural_compare();
|
|
75
|
-
|
|
140
|
+
module.exports = {
|
|
76
141
|
meta: {
|
|
77
142
|
type: "suggestion",
|
|
78
143
|
fixable: "code",
|
|
@@ -301,97 +366,15 @@ var require_sort_keys_fix = __commonJS({
|
|
|
301
366
|
|
|
302
367
|
// node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js
|
|
303
368
|
var require_eslint_plugin_sort_keys = __commonJS({
|
|
304
|
-
"node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js"(exports,
|
|
305
|
-
|
|
306
|
-
module2.exports.rules = {
|
|
369
|
+
"node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js"(exports, module) {
|
|
370
|
+
module.exports.rules = {
|
|
307
371
|
"sort-keys-fix": require_sort_keys_fix()
|
|
308
372
|
};
|
|
309
373
|
}
|
|
310
374
|
});
|
|
311
375
|
|
|
312
|
-
// src/index.ts
|
|
313
|
-
var src_exports = {};
|
|
314
|
-
__export(src_exports, {
|
|
315
|
-
GLOB_ALL_SRC: () => GLOB_ALL_SRC,
|
|
316
|
-
GLOB_CSS: () => GLOB_CSS,
|
|
317
|
-
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
318
|
-
GLOB_HTML: () => GLOB_HTML,
|
|
319
|
-
GLOB_JS: () => GLOB_JS,
|
|
320
|
-
GLOB_JSON: () => GLOB_JSON,
|
|
321
|
-
GLOB_JSON5: () => GLOB_JSON5,
|
|
322
|
-
GLOB_JSONC: () => GLOB_JSONC,
|
|
323
|
-
GLOB_JSX: () => GLOB_JSX,
|
|
324
|
-
GLOB_LESS: () => GLOB_LESS,
|
|
325
|
-
GLOB_MARKDOWN: () => GLOB_MARKDOWN,
|
|
326
|
-
GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
|
|
327
|
-
GLOB_SCSS: () => GLOB_SCSS,
|
|
328
|
-
GLOB_SRC: () => GLOB_SRC,
|
|
329
|
-
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
330
|
-
GLOB_STYLE: () => GLOB_STYLE,
|
|
331
|
-
GLOB_TESTS: () => GLOB_TESTS,
|
|
332
|
-
GLOB_TS: () => GLOB_TS,
|
|
333
|
-
GLOB_TSX: () => GLOB_TSX,
|
|
334
|
-
GLOB_YAML: () => GLOB_YAML,
|
|
335
|
-
combine: () => combine,
|
|
336
|
-
comments: () => comments,
|
|
337
|
-
default: () => jsse,
|
|
338
|
-
ignores: () => ignores,
|
|
339
|
-
imports: () => imports,
|
|
340
|
-
isCI: () => isCI,
|
|
341
|
-
isInEditor: () => isInEditor,
|
|
342
|
-
javascript: () => javascript,
|
|
343
|
-
jsdoc: () => jsdoc,
|
|
344
|
-
jsonc: () => jsonc,
|
|
345
|
-
jsse: () => jsse,
|
|
346
|
-
node: () => node,
|
|
347
|
-
parserJsonc: () => import_jsonc_eslint_parser.default,
|
|
348
|
-
parserTs: () => parserTs,
|
|
349
|
-
pluginEslintComments: () => import_eslint_plugin_eslint_comments.default,
|
|
350
|
-
pluginImport: () => pluginImport,
|
|
351
|
-
pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
|
|
352
|
-
pluginJsonc: () => pluginJsonc,
|
|
353
|
-
pluginNoOnlyTests: () => import_eslint_plugin_no_only_tests.default,
|
|
354
|
-
pluginNode: () => import_eslint_plugin_n.default,
|
|
355
|
-
pluginReact: () => import_eslint_plugin_react.default,
|
|
356
|
-
pluginReactHooks: () => import_eslint_plugin_react_hooks.default,
|
|
357
|
-
pluginReactRefresh: () => pluginReactRefresh,
|
|
358
|
-
pluginSortKeys: () => pluginSortKeys,
|
|
359
|
-
pluginStylistic: () => import_eslint_plugin.default,
|
|
360
|
-
pluginTailwind: () => import_eslint_plugin_tailwindcss.default,
|
|
361
|
-
pluginTs: () => import_eslint_plugin2.default,
|
|
362
|
-
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
363
|
-
pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
|
|
364
|
-
pluginVitest: () => import_eslint_plugin_vitest.default,
|
|
365
|
-
react: () => react,
|
|
366
|
-
reactHooks: () => reactHooks,
|
|
367
|
-
renameRules: () => renameRules,
|
|
368
|
-
sortPackageJson: () => sortPackageJson,
|
|
369
|
-
sortTsconfig: () => sortTsconfig,
|
|
370
|
-
test: () => test,
|
|
371
|
-
typescript: () => typescript,
|
|
372
|
-
unicorn: () => unicorn
|
|
373
|
-
});
|
|
374
|
-
module.exports = __toCommonJS(src_exports);
|
|
375
|
-
|
|
376
376
|
// src/plugins.ts
|
|
377
|
-
var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
|
|
378
|
-
var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
379
|
-
var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
|
|
380
|
-
var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
381
|
-
var pluginImport = __toESM(require("eslint-plugin-i"), 1);
|
|
382
|
-
var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
|
|
383
|
-
var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
384
|
-
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
385
|
-
var import_eslint_plugin_no_only_tests = __toESM(require("eslint-plugin-no-only-tests"), 1);
|
|
386
|
-
var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
|
|
387
|
-
var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
|
|
388
|
-
var pluginReactRefresh = __toESM(require("eslint-plugin-react-refresh"), 1);
|
|
389
377
|
var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
|
|
390
|
-
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
391
|
-
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
392
|
-
var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"), 1);
|
|
393
|
-
var import_eslint_plugin_vitest = __toESM(require("eslint-plugin-vitest"), 1);
|
|
394
|
-
var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
|
|
395
378
|
|
|
396
379
|
// src/configs/comments.ts
|
|
397
380
|
function comments() {
|
|
@@ -400,7 +383,7 @@ function comments() {
|
|
|
400
383
|
name: "jsse:eslint-comments",
|
|
401
384
|
plugins: {
|
|
402
385
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
403
|
-
"eslint-comments":
|
|
386
|
+
"eslint-comments": default4__default.default
|
|
404
387
|
},
|
|
405
388
|
rules: {
|
|
406
389
|
"eslint-comments/no-aggregating-enable": "error",
|
|
@@ -486,7 +469,7 @@ function imports(options = {}) {
|
|
|
486
469
|
name: "jsse:imports",
|
|
487
470
|
plugins: {
|
|
488
471
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
489
|
-
import:
|
|
472
|
+
import: pluginImport__namespace
|
|
490
473
|
},
|
|
491
474
|
rules: {
|
|
492
475
|
"import/first": "error",
|
|
@@ -503,24 +486,16 @@ function imports(options = {}) {
|
|
|
503
486
|
}
|
|
504
487
|
];
|
|
505
488
|
}
|
|
506
|
-
|
|
507
|
-
// src/configs/javascript.ts
|
|
508
|
-
var import_js = __toESM(require("@eslint/js"), 1);
|
|
509
|
-
var import_globals = __toESM(require("globals"), 1);
|
|
510
489
|
function javascript(options = {}) {
|
|
511
490
|
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
512
491
|
return [
|
|
513
492
|
{
|
|
514
493
|
languageOptions: {
|
|
515
494
|
ecmaVersion: 2022,
|
|
516
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
517
495
|
globals: {
|
|
518
|
-
|
|
519
|
-
...
|
|
520
|
-
|
|
521
|
-
...import_globals.default.es2021,
|
|
522
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
523
|
-
...import_globals.default.node,
|
|
496
|
+
...globals__default.default.browser,
|
|
497
|
+
...globals__default.default.es2021,
|
|
498
|
+
...globals__default.default.node,
|
|
524
499
|
document: "readonly",
|
|
525
500
|
navigator: "readonly",
|
|
526
501
|
window: "readonly"
|
|
@@ -540,10 +515,10 @@ function javascript(options = {}) {
|
|
|
540
515
|
name: "jsse:javascript",
|
|
541
516
|
plugins: {
|
|
542
517
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
543
|
-
"unused-imports":
|
|
518
|
+
"unused-imports": default11__default.default
|
|
544
519
|
},
|
|
545
520
|
rules: {
|
|
546
|
-
...
|
|
521
|
+
...eslintjs__default.default.configs.recommended.rules,
|
|
547
522
|
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
548
523
|
"array-callback-return": "error",
|
|
549
524
|
"arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
|
|
@@ -762,7 +737,7 @@ function jsdoc(options = {}) {
|
|
|
762
737
|
name: "jsse:jsdoc",
|
|
763
738
|
plugins: {
|
|
764
739
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
765
|
-
jsdoc:
|
|
740
|
+
jsdoc: default5__default.default
|
|
766
741
|
},
|
|
767
742
|
rules: {
|
|
768
743
|
"jsdoc/check-access": "warn",
|
|
@@ -798,13 +773,13 @@ function jsonc(options = {}) {
|
|
|
798
773
|
name: "jsse:jsonc:setup",
|
|
799
774
|
plugins: {
|
|
800
775
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
801
|
-
jsonc:
|
|
776
|
+
jsonc: pluginJsonc__namespace
|
|
802
777
|
}
|
|
803
778
|
},
|
|
804
779
|
{
|
|
805
780
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
806
781
|
languageOptions: {
|
|
807
|
-
parser:
|
|
782
|
+
parser: default14__default.default
|
|
808
783
|
},
|
|
809
784
|
name: "jsse:jsonc:rules",
|
|
810
785
|
rules: {
|
|
@@ -859,7 +834,7 @@ function node() {
|
|
|
859
834
|
name: "jsse:node",
|
|
860
835
|
plugins: {
|
|
861
836
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
862
|
-
node:
|
|
837
|
+
node: default6__default.default
|
|
863
838
|
},
|
|
864
839
|
rules: {
|
|
865
840
|
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
@@ -874,9 +849,6 @@ function node() {
|
|
|
874
849
|
}
|
|
875
850
|
];
|
|
876
851
|
}
|
|
877
|
-
|
|
878
|
-
// src/configs/ts/typescript-language-options.ts
|
|
879
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
880
852
|
function parserOptionProject(tsconfigPath) {
|
|
881
853
|
if (typeof tsconfigPath === "string") {
|
|
882
854
|
return [tsconfigPath];
|
|
@@ -887,7 +859,7 @@ function typescriptLanguageOptions(options) {
|
|
|
887
859
|
const { parserOptions = {}, tsconfigPath, react: react2 } = options ?? {};
|
|
888
860
|
if (react2) {
|
|
889
861
|
return {
|
|
890
|
-
parser:
|
|
862
|
+
parser: parserTs__namespace,
|
|
891
863
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
892
864
|
parserOptions: {
|
|
893
865
|
ecmaFeatures: { jsx: true, modules: true },
|
|
@@ -895,7 +867,7 @@ function typescriptLanguageOptions(options) {
|
|
|
895
867
|
sourceType: "module",
|
|
896
868
|
...tsconfigPath ? {
|
|
897
869
|
project: parserOptionProject(tsconfigPath),
|
|
898
|
-
tsconfigRootDir:
|
|
870
|
+
tsconfigRootDir: process2__default.default.cwd()
|
|
899
871
|
} : {},
|
|
900
872
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
901
873
|
...parserOptions
|
|
@@ -903,13 +875,13 @@ function typescriptLanguageOptions(options) {
|
|
|
903
875
|
};
|
|
904
876
|
}
|
|
905
877
|
return {
|
|
906
|
-
parser:
|
|
878
|
+
parser: parserTs__namespace,
|
|
907
879
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
908
880
|
parserOptions: {
|
|
909
881
|
sourceType: "module",
|
|
910
882
|
...tsconfigPath ? {
|
|
911
883
|
project: parserOptionProject(tsconfigPath),
|
|
912
|
-
tsconfigRootDir:
|
|
884
|
+
tsconfigRootDir: process2__default.default.cwd()
|
|
913
885
|
} : {},
|
|
914
886
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
915
887
|
...parserOptions
|
|
@@ -1088,7 +1060,7 @@ function reactHooks() {
|
|
|
1088
1060
|
{
|
|
1089
1061
|
files: [GLOB_SRC],
|
|
1090
1062
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1091
|
-
plugins: { "react-hooks":
|
|
1063
|
+
plugins: { "react-hooks": default9__default.default },
|
|
1092
1064
|
rules: {
|
|
1093
1065
|
"react-hooks/exhaustive-deps": "error",
|
|
1094
1066
|
"react-hooks/rules-of-hooks": "error"
|
|
@@ -1101,7 +1073,7 @@ function reactRefreshFlatConfigs() {
|
|
|
1101
1073
|
{
|
|
1102
1074
|
files: [GLOB_SRC],
|
|
1103
1075
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1104
|
-
plugins: { "react-refresh":
|
|
1076
|
+
plugins: { "react-refresh": pluginReactRefresh__namespace },
|
|
1105
1077
|
rules: {
|
|
1106
1078
|
"react-refresh/only-export-components": "error"
|
|
1107
1079
|
}
|
|
@@ -1109,7 +1081,7 @@ function reactRefreshFlatConfigs() {
|
|
|
1109
1081
|
{
|
|
1110
1082
|
files: ["**/*.stories.tsx"],
|
|
1111
1083
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1112
|
-
plugins: { "react-refresh":
|
|
1084
|
+
plugins: { "react-refresh": pluginReactRefresh__namespace },
|
|
1113
1085
|
rules: {
|
|
1114
1086
|
"react-refresh/only-export-components": "off"
|
|
1115
1087
|
}
|
|
@@ -1156,9 +1128,9 @@ function react(options) {
|
|
|
1156
1128
|
name: "jsse:react:setup",
|
|
1157
1129
|
plugins: {
|
|
1158
1130
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1159
|
-
react:
|
|
1131
|
+
react: default8__default.default,
|
|
1160
1132
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1161
|
-
"react-hooks":
|
|
1133
|
+
"react-hooks": default9__default.default
|
|
1162
1134
|
}
|
|
1163
1135
|
},
|
|
1164
1136
|
{
|
|
@@ -1171,7 +1143,7 @@ function react(options) {
|
|
|
1171
1143
|
rules: {
|
|
1172
1144
|
...reactRecomendedRules(),
|
|
1173
1145
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1174
|
-
...
|
|
1146
|
+
...default8__default.default.configs["jsx-runtime"].rules,
|
|
1175
1147
|
...reactRules
|
|
1176
1148
|
},
|
|
1177
1149
|
settings: {
|
|
@@ -1390,9 +1362,6 @@ function sortTsconfig() {
|
|
|
1390
1362
|
}
|
|
1391
1363
|
];
|
|
1392
1364
|
}
|
|
1393
|
-
|
|
1394
|
-
// src/utils.ts
|
|
1395
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
|
1396
1365
|
function combine(...configs) {
|
|
1397
1366
|
return configs.flatMap((config) => Array.isArray(config) ? config : [config]);
|
|
1398
1367
|
}
|
|
@@ -1410,10 +1379,10 @@ function renameRules(rules, from, to) {
|
|
|
1410
1379
|
);
|
|
1411
1380
|
}
|
|
1412
1381
|
function isCI() {
|
|
1413
|
-
return !!
|
|
1382
|
+
return !!process2__default.default.env.CI;
|
|
1414
1383
|
}
|
|
1415
1384
|
function isInEditor() {
|
|
1416
|
-
return !!((
|
|
1385
|
+
return !!((process2__default.default.env.VSCODE_PID || process2__default.default.env.JETBRAINS_IDE) && !isCI());
|
|
1417
1386
|
}
|
|
1418
1387
|
|
|
1419
1388
|
// src/configs/test.ts
|
|
@@ -1424,13 +1393,13 @@ function test(options = {}) {
|
|
|
1424
1393
|
name: "jsse:test:setup",
|
|
1425
1394
|
plugins: {
|
|
1426
1395
|
test: {
|
|
1427
|
-
...
|
|
1396
|
+
...default13__default.default,
|
|
1428
1397
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1429
1398
|
rules: {
|
|
1430
|
-
...
|
|
1399
|
+
...default13__default.default.rules,
|
|
1431
1400
|
// extend `test/no-only-tests` rule
|
|
1432
1401
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1433
|
-
...
|
|
1402
|
+
...default7__default.default.rules
|
|
1434
1403
|
}
|
|
1435
1404
|
}
|
|
1436
1405
|
}
|
|
@@ -1873,9 +1842,9 @@ function typescript(options) {
|
|
|
1873
1842
|
const tsPrefixTo = prefix?.to ?? "ts";
|
|
1874
1843
|
const tsrules = {
|
|
1875
1844
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1876
|
-
...
|
|
1845
|
+
...default3__default.default.configs["eslint-recommended"].overrides[0].rules,
|
|
1877
1846
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1878
|
-
...
|
|
1847
|
+
...default3__default.default.configs.strict.rules,
|
|
1879
1848
|
"no-invalid-this": "off",
|
|
1880
1849
|
...typescriptRules(tsconfigPath ? { typeAware: true } : { typeAware: false }),
|
|
1881
1850
|
...overrides
|
|
@@ -1886,8 +1855,8 @@ function typescript(options) {
|
|
|
1886
1855
|
name: "jsse:typescript:setup",
|
|
1887
1856
|
plugins: {
|
|
1888
1857
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1889
|
-
import:
|
|
1890
|
-
[tsPrefixTo]:
|
|
1858
|
+
import: pluginImport__namespace,
|
|
1859
|
+
[tsPrefixTo]: default3__default.default
|
|
1891
1860
|
}
|
|
1892
1861
|
},
|
|
1893
1862
|
{
|
|
@@ -1957,7 +1926,7 @@ function unicorn() {
|
|
|
1957
1926
|
name: "jsse:unicorn",
|
|
1958
1927
|
plugins: {
|
|
1959
1928
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1960
|
-
unicorn:
|
|
1929
|
+
unicorn: default10__default.default
|
|
1961
1930
|
},
|
|
1962
1931
|
rules: {
|
|
1963
1932
|
...unicornOff(),
|
|
@@ -2034,11 +2003,6 @@ function unicorn() {
|
|
|
2034
2003
|
];
|
|
2035
2004
|
}
|
|
2036
2005
|
|
|
2037
|
-
// src/factory.ts
|
|
2038
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
|
2039
|
-
var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1);
|
|
2040
|
-
var import_local_pkg = require("local-pkg");
|
|
2041
|
-
|
|
2042
2006
|
// src/configs/tailwind.ts
|
|
2043
2007
|
function tailwind() {
|
|
2044
2008
|
return [
|
|
@@ -2046,12 +2010,12 @@ function tailwind() {
|
|
|
2046
2010
|
name: "jsse:tailwind",
|
|
2047
2011
|
plugins: {
|
|
2048
2012
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2049
|
-
tailwindcss:
|
|
2013
|
+
tailwindcss: default12__default.default
|
|
2050
2014
|
},
|
|
2051
2015
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2052
2016
|
rules: {
|
|
2053
2017
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2054
|
-
...
|
|
2018
|
+
...default12__default.default.configs.recommended.rules
|
|
2055
2019
|
}
|
|
2056
2020
|
}
|
|
2057
2021
|
];
|
|
@@ -2070,7 +2034,7 @@ var flatConfigProps = [
|
|
|
2070
2034
|
];
|
|
2071
2035
|
function defaultOptions() {
|
|
2072
2036
|
return {
|
|
2073
|
-
gitignore:
|
|
2037
|
+
gitignore: gitignore__default.default,
|
|
2074
2038
|
isInEditor: isInEditor(),
|
|
2075
2039
|
jsonc: true,
|
|
2076
2040
|
off: [],
|
|
@@ -2078,7 +2042,7 @@ function defaultOptions() {
|
|
|
2078
2042
|
stylistic: true,
|
|
2079
2043
|
test: true,
|
|
2080
2044
|
tsPrefix: "@typescript-eslint",
|
|
2081
|
-
typescript:
|
|
2045
|
+
typescript: localPkg.isPackageExists("typescript")
|
|
2082
2046
|
};
|
|
2083
2047
|
}
|
|
2084
2048
|
function opts(options = {}) {
|
|
@@ -2090,11 +2054,11 @@ function opts(options = {}) {
|
|
|
2090
2054
|
function jsse(options = {}, ...userConfigs) {
|
|
2091
2055
|
const {
|
|
2092
2056
|
isInEditor: isInEditor2,
|
|
2093
|
-
typescript: enableTypeScript =
|
|
2057
|
+
typescript: enableTypeScript = localPkg.isPackageExists("typescript"),
|
|
2094
2058
|
gitignore: enableGitignore = true,
|
|
2095
2059
|
overrides = {},
|
|
2096
2060
|
componentExts = [],
|
|
2097
|
-
react: enableReact =
|
|
2061
|
+
react: enableReact = localPkg.isPackageExists("react"),
|
|
2098
2062
|
reportUnusedDisableDirectives,
|
|
2099
2063
|
tsPrefix,
|
|
2100
2064
|
off
|
|
@@ -2103,8 +2067,8 @@ function jsse(options = {}, ...userConfigs) {
|
|
|
2103
2067
|
if (stylisticOptions && !("jsx" in stylisticOptions))
|
|
2104
2068
|
stylisticOptions.jsx = options.jsx ?? true;
|
|
2105
2069
|
const configs = [];
|
|
2106
|
-
if (enableGitignore &&
|
|
2107
|
-
configs.push([
|
|
2070
|
+
if (enableGitignore && fs__default.default.existsSync(".gitignore")) {
|
|
2071
|
+
configs.push([gitignore__default.default()]);
|
|
2108
2072
|
}
|
|
2109
2073
|
configs.push(
|
|
2110
2074
|
ignores(),
|
|
@@ -2186,66 +2150,18 @@ function jsse(options = {}, ...userConfigs) {
|
|
|
2186
2150
|
}
|
|
2187
2151
|
return combine(...configs, ...userConfigs);
|
|
2188
2152
|
}
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
GLOB_MARKDOWN,
|
|
2202
|
-
GLOB_MARKDOWN_CODE,
|
|
2203
|
-
GLOB_SCSS,
|
|
2204
|
-
GLOB_SRC,
|
|
2205
|
-
GLOB_SRC_EXT,
|
|
2206
|
-
GLOB_STYLE,
|
|
2207
|
-
GLOB_TESTS,
|
|
2208
|
-
GLOB_TS,
|
|
2209
|
-
GLOB_TSX,
|
|
2210
|
-
GLOB_YAML,
|
|
2211
|
-
combine,
|
|
2212
|
-
comments,
|
|
2213
|
-
ignores,
|
|
2214
|
-
imports,
|
|
2215
|
-
isCI,
|
|
2216
|
-
isInEditor,
|
|
2217
|
-
javascript,
|
|
2218
|
-
jsdoc,
|
|
2219
|
-
jsonc,
|
|
2220
|
-
jsse,
|
|
2221
|
-
node,
|
|
2222
|
-
parserJsonc,
|
|
2223
|
-
parserTs,
|
|
2224
|
-
pluginEslintComments,
|
|
2225
|
-
pluginImport,
|
|
2226
|
-
pluginJsdoc,
|
|
2227
|
-
pluginJsonc,
|
|
2228
|
-
pluginNoOnlyTests,
|
|
2229
|
-
pluginNode,
|
|
2230
|
-
pluginReact,
|
|
2231
|
-
pluginReactHooks,
|
|
2232
|
-
pluginReactRefresh,
|
|
2233
|
-
pluginSortKeys,
|
|
2234
|
-
pluginStylistic,
|
|
2235
|
-
pluginTailwind,
|
|
2236
|
-
pluginTs,
|
|
2237
|
-
pluginUnicorn,
|
|
2238
|
-
pluginUnusedImports,
|
|
2239
|
-
pluginVitest,
|
|
2240
|
-
react,
|
|
2241
|
-
reactHooks,
|
|
2242
|
-
renameRules,
|
|
2243
|
-
sortPackageJson,
|
|
2244
|
-
sortTsconfig,
|
|
2245
|
-
test,
|
|
2246
|
-
typescript,
|
|
2247
|
-
unicorn
|
|
2248
|
-
});
|
|
2153
|
+
|
|
2154
|
+
// src/presets.ts
|
|
2155
|
+
function jssestd() {
|
|
2156
|
+
return jsse({
|
|
2157
|
+
typescript: {
|
|
2158
|
+
tsconfigPath: ["./tsconfig.json", "./tsconfig.eslint.json"]
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
function jsseReact() {
|
|
2163
|
+
return jsse({ react: true });
|
|
2164
|
+
}
|
|
2249
2165
|
/*! Bundled license information:
|
|
2250
2166
|
|
|
2251
2167
|
natural-compare/index.js:
|
|
@@ -2257,3 +2173,107 @@ natural-compare/index.js:
|
|
|
2257
2173
|
* @license MIT License
|
|
2258
2174
|
*)
|
|
2259
2175
|
*/
|
|
2176
|
+
|
|
2177
|
+
Object.defineProperty(exports, 'pluginStylistic', {
|
|
2178
|
+
enumerable: true,
|
|
2179
|
+
get: function () { return eslintPlugin__default.default; }
|
|
2180
|
+
});
|
|
2181
|
+
Object.defineProperty(exports, 'pluginTs', {
|
|
2182
|
+
enumerable: true,
|
|
2183
|
+
get: function () { return default3__default.default; }
|
|
2184
|
+
});
|
|
2185
|
+
exports.parserTs = parserTs__namespace;
|
|
2186
|
+
Object.defineProperty(exports, 'pluginEslintComments', {
|
|
2187
|
+
enumerable: true,
|
|
2188
|
+
get: function () { return default4__default.default; }
|
|
2189
|
+
});
|
|
2190
|
+
exports.pluginImport = pluginImport__namespace;
|
|
2191
|
+
Object.defineProperty(exports, 'pluginJsdoc', {
|
|
2192
|
+
enumerable: true,
|
|
2193
|
+
get: function () { return default5__default.default; }
|
|
2194
|
+
});
|
|
2195
|
+
exports.pluginJsonc = pluginJsonc__namespace;
|
|
2196
|
+
Object.defineProperty(exports, 'pluginNode', {
|
|
2197
|
+
enumerable: true,
|
|
2198
|
+
get: function () { return default6__default.default; }
|
|
2199
|
+
});
|
|
2200
|
+
Object.defineProperty(exports, 'pluginNoOnlyTests', {
|
|
2201
|
+
enumerable: true,
|
|
2202
|
+
get: function () { return default7__default.default; }
|
|
2203
|
+
});
|
|
2204
|
+
Object.defineProperty(exports, 'pluginReact', {
|
|
2205
|
+
enumerable: true,
|
|
2206
|
+
get: function () { return default8__default.default; }
|
|
2207
|
+
});
|
|
2208
|
+
Object.defineProperty(exports, 'pluginReactHooks', {
|
|
2209
|
+
enumerable: true,
|
|
2210
|
+
get: function () { return default9__default.default; }
|
|
2211
|
+
});
|
|
2212
|
+
exports.pluginReactRefresh = pluginReactRefresh__namespace;
|
|
2213
|
+
Object.defineProperty(exports, 'pluginUnicorn', {
|
|
2214
|
+
enumerable: true,
|
|
2215
|
+
get: function () { return default10__default.default; }
|
|
2216
|
+
});
|
|
2217
|
+
Object.defineProperty(exports, 'pluginUnusedImports', {
|
|
2218
|
+
enumerable: true,
|
|
2219
|
+
get: function () { return default11__default.default; }
|
|
2220
|
+
});
|
|
2221
|
+
Object.defineProperty(exports, 'pluginTailwind', {
|
|
2222
|
+
enumerable: true,
|
|
2223
|
+
get: function () { return default12__default.default; }
|
|
2224
|
+
});
|
|
2225
|
+
Object.defineProperty(exports, 'pluginVitest', {
|
|
2226
|
+
enumerable: true,
|
|
2227
|
+
get: function () { return default13__default.default; }
|
|
2228
|
+
});
|
|
2229
|
+
Object.defineProperty(exports, 'parserJsonc', {
|
|
2230
|
+
enumerable: true,
|
|
2231
|
+
get: function () { return default14__default.default; }
|
|
2232
|
+
});
|
|
2233
|
+
Object.defineProperty(exports, 'pluginMarkdown', {
|
|
2234
|
+
enumerable: true,
|
|
2235
|
+
get: function () { return eslintPluginMarkdown__default.default; }
|
|
2236
|
+
});
|
|
2237
|
+
exports.GLOB_ALL_SRC = GLOB_ALL_SRC;
|
|
2238
|
+
exports.GLOB_CSS = GLOB_CSS;
|
|
2239
|
+
exports.GLOB_EXCLUDE = GLOB_EXCLUDE;
|
|
2240
|
+
exports.GLOB_HTML = GLOB_HTML;
|
|
2241
|
+
exports.GLOB_JS = GLOB_JS;
|
|
2242
|
+
exports.GLOB_JSON = GLOB_JSON;
|
|
2243
|
+
exports.GLOB_JSON5 = GLOB_JSON5;
|
|
2244
|
+
exports.GLOB_JSONC = GLOB_JSONC;
|
|
2245
|
+
exports.GLOB_JSX = GLOB_JSX;
|
|
2246
|
+
exports.GLOB_LESS = GLOB_LESS;
|
|
2247
|
+
exports.GLOB_MARKDOWN = GLOB_MARKDOWN;
|
|
2248
|
+
exports.GLOB_MARKDOWN_CODE = GLOB_MARKDOWN_CODE;
|
|
2249
|
+
exports.GLOB_SCSS = GLOB_SCSS;
|
|
2250
|
+
exports.GLOB_SRC = GLOB_SRC;
|
|
2251
|
+
exports.GLOB_SRC_EXT = GLOB_SRC_EXT;
|
|
2252
|
+
exports.GLOB_STYLE = GLOB_STYLE;
|
|
2253
|
+
exports.GLOB_TESTS = GLOB_TESTS;
|
|
2254
|
+
exports.GLOB_TS = GLOB_TS;
|
|
2255
|
+
exports.GLOB_TSX = GLOB_TSX;
|
|
2256
|
+
exports.GLOB_YAML = GLOB_YAML;
|
|
2257
|
+
exports.combine = combine;
|
|
2258
|
+
exports.comments = comments;
|
|
2259
|
+
exports.default = jsse;
|
|
2260
|
+
exports.ignores = ignores;
|
|
2261
|
+
exports.imports = imports;
|
|
2262
|
+
exports.isCI = isCI;
|
|
2263
|
+
exports.isInEditor = isInEditor;
|
|
2264
|
+
exports.javascript = javascript;
|
|
2265
|
+
exports.jsdoc = jsdoc;
|
|
2266
|
+
exports.jsonc = jsonc;
|
|
2267
|
+
exports.jsse = jsse;
|
|
2268
|
+
exports.jsseReact = jsseReact;
|
|
2269
|
+
exports.jssestd = jssestd;
|
|
2270
|
+
exports.node = node;
|
|
2271
|
+
exports.pluginSortKeys = pluginSortKeys;
|
|
2272
|
+
exports.react = react;
|
|
2273
|
+
exports.reactHooks = reactHooks;
|
|
2274
|
+
exports.renameRules = renameRules;
|
|
2275
|
+
exports.sortPackageJson = sortPackageJson;
|
|
2276
|
+
exports.sortTsconfig = sortTsconfig;
|
|
2277
|
+
exports.test = test;
|
|
2278
|
+
exports.typescript = typescript;
|
|
2279
|
+
exports.unicorn = unicorn;
|