@luxass/eslint-config 4.5.0 → 4.7.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.
- package/README.md +49 -49
- package/dist/index.cjs +122 -324
- package/dist/index.d.cts +54 -733
- package/dist/index.d.ts +54 -733
- package/dist/index.js +121 -322
- package/package.json +14 -30
package/dist/index.js
CHANGED
|
@@ -424,172 +424,6 @@ function sortTsconfig() {
|
|
|
424
424
|
];
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
// src/utils.ts
|
|
428
|
-
import process from "node:process";
|
|
429
|
-
import { isPackageExists } from "local-pkg";
|
|
430
|
-
var parserPlain = {
|
|
431
|
-
meta: {
|
|
432
|
-
name: "parser-plain"
|
|
433
|
-
},
|
|
434
|
-
parseForESLint: (code) => ({
|
|
435
|
-
ast: {
|
|
436
|
-
body: [],
|
|
437
|
-
comments: [],
|
|
438
|
-
loc: { end: code.length, start: 0 },
|
|
439
|
-
range: [0, code.length],
|
|
440
|
-
tokens: [],
|
|
441
|
-
type: "Program"
|
|
442
|
-
},
|
|
443
|
-
scopeManager: null,
|
|
444
|
-
services: { isPlain: true },
|
|
445
|
-
visitorKeys: {
|
|
446
|
-
Program: []
|
|
447
|
-
}
|
|
448
|
-
})
|
|
449
|
-
};
|
|
450
|
-
async function combine(...configs2) {
|
|
451
|
-
const resolved = await Promise.all(configs2);
|
|
452
|
-
return resolved.flat();
|
|
453
|
-
}
|
|
454
|
-
function renameRules(rules, from, to) {
|
|
455
|
-
return Object.fromEntries(
|
|
456
|
-
Object.entries(rules).map(([key, value]) => {
|
|
457
|
-
if (key.startsWith(from)) {
|
|
458
|
-
return [to + key.slice(from.length), value];
|
|
459
|
-
}
|
|
460
|
-
return [key, value];
|
|
461
|
-
})
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
function toArray(value) {
|
|
465
|
-
return Array.isArray(value) ? value : [value];
|
|
466
|
-
}
|
|
467
|
-
async function interop(m) {
|
|
468
|
-
const resolved = await m;
|
|
469
|
-
return resolved.default || resolved;
|
|
470
|
-
}
|
|
471
|
-
async function ensure(packages) {
|
|
472
|
-
if (process.env.CI || process.stdout.isTTY === false) {
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
;
|
|
476
|
-
const nonExistingPackages = packages.filter((i) => i && !isPackageExists(i));
|
|
477
|
-
if (nonExistingPackages.length === 0) {
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
const p = await import("@clack/prompts");
|
|
481
|
-
const result = await p.confirm({
|
|
482
|
-
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
483
|
-
});
|
|
484
|
-
if (result) {
|
|
485
|
-
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
function resolveSubOptions(options, key) {
|
|
489
|
-
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
490
|
-
}
|
|
491
|
-
function getOverrides(options, key) {
|
|
492
|
-
const sub = resolveSubOptions(options, key);
|
|
493
|
-
return {
|
|
494
|
-
..."overrides" in sub ? sub.overrides : {}
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
// src/configs/svelte.ts
|
|
499
|
-
async function svelte(options = {}) {
|
|
500
|
-
const {
|
|
501
|
-
files = [GLOB_SVELTE],
|
|
502
|
-
overrides = {},
|
|
503
|
-
stylistic: stylistic2 = true
|
|
504
|
-
} = options;
|
|
505
|
-
const {
|
|
506
|
-
indent = 2,
|
|
507
|
-
quotes = "single"
|
|
508
|
-
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
509
|
-
await ensure([
|
|
510
|
-
"eslint-plugin-svelte"
|
|
511
|
-
]);
|
|
512
|
-
const [
|
|
513
|
-
pluginSvelte,
|
|
514
|
-
parserSvelte
|
|
515
|
-
] = await Promise.all([
|
|
516
|
-
interop(import("eslint-plugin-svelte")),
|
|
517
|
-
interop(import("svelte-eslint-parser"))
|
|
518
|
-
]);
|
|
519
|
-
return [
|
|
520
|
-
{
|
|
521
|
-
name: "antfu/svelte/setup",
|
|
522
|
-
plugins: {
|
|
523
|
-
svelte: pluginSvelte
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
files,
|
|
528
|
-
languageOptions: {
|
|
529
|
-
parser: parserSvelte,
|
|
530
|
-
parserOptions: {
|
|
531
|
-
extraFileExtensions: [".svelte"],
|
|
532
|
-
parser: options.typescript ? await interop(import("@typescript-eslint/parser")) : null
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
name: "antfu/svelte/rules",
|
|
536
|
-
processor: pluginSvelte.processors[".svelte"],
|
|
537
|
-
rules: {
|
|
538
|
-
"import/no-mutable-exports": "off",
|
|
539
|
-
"no-undef": "off",
|
|
540
|
-
// incompatible with most recent (attribute-form) generic types RFC
|
|
541
|
-
"no-unused-vars": ["error", {
|
|
542
|
-
args: "none",
|
|
543
|
-
caughtErrors: "none",
|
|
544
|
-
ignoreRestSiblings: true,
|
|
545
|
-
vars: "all",
|
|
546
|
-
varsIgnorePattern: "^(\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
547
|
-
}],
|
|
548
|
-
"svelte/comment-directive": "error",
|
|
549
|
-
"svelte/no-at-debug-tags": "warn",
|
|
550
|
-
"svelte/no-at-html-tags": "error",
|
|
551
|
-
"svelte/no-dupe-else-if-blocks": "error",
|
|
552
|
-
"svelte/no-dupe-style-properties": "error",
|
|
553
|
-
"svelte/no-dupe-use-directives": "error",
|
|
554
|
-
"svelte/no-dynamic-slot-name": "error",
|
|
555
|
-
"svelte/no-export-load-in-svelte-module-in-kit-pages": "error",
|
|
556
|
-
"svelte/no-inner-declarations": "error",
|
|
557
|
-
"svelte/no-not-function-handler": "error",
|
|
558
|
-
"svelte/no-object-in-text-mustaches": "error",
|
|
559
|
-
"svelte/no-reactive-functions": "error",
|
|
560
|
-
"svelte/no-reactive-literals": "error",
|
|
561
|
-
"svelte/no-shorthand-style-property-overrides": "error",
|
|
562
|
-
"svelte/no-unknown-style-directive-property": "error",
|
|
563
|
-
"svelte/no-unused-svelte-ignore": "error",
|
|
564
|
-
"svelte/no-useless-mustaches": "error",
|
|
565
|
-
"svelte/require-store-callbacks-use-set-param": "error",
|
|
566
|
-
"svelte/system": "error",
|
|
567
|
-
"svelte/valid-compile": "error",
|
|
568
|
-
"svelte/valid-each-key": "error",
|
|
569
|
-
"unused-imports/no-unused-vars": [
|
|
570
|
-
"error",
|
|
571
|
-
{ args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^(_|\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)" }
|
|
572
|
-
],
|
|
573
|
-
...stylistic2 ? {
|
|
574
|
-
"style/indent": "off",
|
|
575
|
-
// superseded by svelte/indent
|
|
576
|
-
"style/no-trailing-spaces": "off",
|
|
577
|
-
// superseded by svelte/no-trailing-spaces
|
|
578
|
-
"svelte/derived-has-same-inputs-outputs": "error",
|
|
579
|
-
"svelte/html-closing-bracket-spacing": "error",
|
|
580
|
-
"svelte/html-quotes": ["error", { prefer: quotes }],
|
|
581
|
-
"svelte/indent": ["error", { alignAttributesVertically: true, indent }],
|
|
582
|
-
"svelte/mustache-spacing": "error",
|
|
583
|
-
"svelte/no-spaces-around-equal-signs-in-attribute": "error",
|
|
584
|
-
"svelte/no-trailing-spaces": "error",
|
|
585
|
-
"svelte/spaced-html-comment": "error"
|
|
586
|
-
} : {},
|
|
587
|
-
...overrides
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
];
|
|
591
|
-
}
|
|
592
|
-
|
|
593
427
|
// src/configs/imports.ts
|
|
594
428
|
import pluginImport from "eslint-plugin-import-x";
|
|
595
429
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
@@ -889,6 +723,77 @@ async function javascript(options = {}) {
|
|
|
889
723
|
];
|
|
890
724
|
}
|
|
891
725
|
|
|
726
|
+
// src/utils.ts
|
|
727
|
+
import process from "node:process";
|
|
728
|
+
import { isPackageExists } from "local-pkg";
|
|
729
|
+
var parserPlain = {
|
|
730
|
+
meta: {
|
|
731
|
+
name: "parser-plain"
|
|
732
|
+
},
|
|
733
|
+
parseForESLint: (code) => ({
|
|
734
|
+
ast: {
|
|
735
|
+
body: [],
|
|
736
|
+
comments: [],
|
|
737
|
+
loc: { end: code.length, start: 0 },
|
|
738
|
+
range: [0, code.length],
|
|
739
|
+
tokens: [],
|
|
740
|
+
type: "Program"
|
|
741
|
+
},
|
|
742
|
+
scopeManager: null,
|
|
743
|
+
services: { isPlain: true },
|
|
744
|
+
visitorKeys: {
|
|
745
|
+
Program: []
|
|
746
|
+
}
|
|
747
|
+
})
|
|
748
|
+
};
|
|
749
|
+
async function combine(...configs2) {
|
|
750
|
+
const resolved = await Promise.all(configs2);
|
|
751
|
+
return resolved.flat();
|
|
752
|
+
}
|
|
753
|
+
function renameRules(rules, from, to) {
|
|
754
|
+
return Object.fromEntries(
|
|
755
|
+
Object.entries(rules).map(([key, value]) => {
|
|
756
|
+
if (key.startsWith(from)) {
|
|
757
|
+
return [to + key.slice(from.length), value];
|
|
758
|
+
}
|
|
759
|
+
return [key, value];
|
|
760
|
+
})
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
function toArray(value) {
|
|
764
|
+
return Array.isArray(value) ? value : [value];
|
|
765
|
+
}
|
|
766
|
+
async function interop(m) {
|
|
767
|
+
const resolved = await m;
|
|
768
|
+
return resolved.default || resolved;
|
|
769
|
+
}
|
|
770
|
+
async function ensure(packages) {
|
|
771
|
+
if (process.env.CI || process.stdout.isTTY === false) {
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
;
|
|
775
|
+
const nonExistingPackages = packages.filter((i) => i && !isPackageExists(i));
|
|
776
|
+
if (nonExistingPackages.length === 0) {
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
const p = await import("@clack/prompts");
|
|
780
|
+
const result = await p.confirm({
|
|
781
|
+
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
782
|
+
});
|
|
783
|
+
if (result) {
|
|
784
|
+
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
function resolveSubOptions(options, key) {
|
|
788
|
+
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
789
|
+
}
|
|
790
|
+
function getOverrides(options, key) {
|
|
791
|
+
const sub = resolveSubOptions(options, key);
|
|
792
|
+
return {
|
|
793
|
+
..."overrides" in sub ? sub.overrides : {}
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
|
|
892
797
|
// src/configs/jsdoc.ts
|
|
893
798
|
async function jsdoc(options = {}) {
|
|
894
799
|
const {
|
|
@@ -1104,13 +1009,13 @@ import pluginAntfu3 from "eslint-plugin-antfu";
|
|
|
1104
1009
|
var StylisticConfigDefaults = {
|
|
1105
1010
|
indent: 2,
|
|
1106
1011
|
jsx: true,
|
|
1107
|
-
quotes: "
|
|
1108
|
-
semi:
|
|
1012
|
+
quotes: "double",
|
|
1013
|
+
semi: true
|
|
1109
1014
|
};
|
|
1110
1015
|
async function stylistic(options = {}) {
|
|
1111
1016
|
const {
|
|
1112
1017
|
indent,
|
|
1113
|
-
jsx,
|
|
1018
|
+
jsx: jsx2,
|
|
1114
1019
|
overrides = {},
|
|
1115
1020
|
quotes,
|
|
1116
1021
|
semi
|
|
@@ -1122,7 +1027,7 @@ async function stylistic(options = {}) {
|
|
|
1122
1027
|
const config = pluginStylistic.configs.customize({
|
|
1123
1028
|
flat: true,
|
|
1124
1029
|
indent,
|
|
1125
|
-
jsx,
|
|
1030
|
+
jsx: jsx2,
|
|
1126
1031
|
pluginName: "style",
|
|
1127
1032
|
quotes,
|
|
1128
1033
|
semi
|
|
@@ -1558,7 +1463,7 @@ async function yaml(options = {}) {
|
|
|
1558
1463
|
]);
|
|
1559
1464
|
const {
|
|
1560
1465
|
indent = 2,
|
|
1561
|
-
quotes = "
|
|
1466
|
+
quotes = "double"
|
|
1562
1467
|
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
1563
1468
|
return [
|
|
1564
1469
|
{
|
|
@@ -1852,7 +1757,6 @@ async function astro(options = {}) {
|
|
|
1852
1757
|
const {
|
|
1853
1758
|
files = [GLOB_ASTRO],
|
|
1854
1759
|
overrides = {},
|
|
1855
|
-
typescript: typescript2 = true,
|
|
1856
1760
|
stylistic: stylistic2 = true
|
|
1857
1761
|
} = options;
|
|
1858
1762
|
await ensure([
|
|
@@ -1879,63 +1783,35 @@ async function astro(options = {}) {
|
|
|
1879
1783
|
name: "luxass/astro/rules",
|
|
1880
1784
|
files,
|
|
1881
1785
|
languageOptions: {
|
|
1786
|
+
globals: pluginAstro.environments.astro.globals,
|
|
1882
1787
|
parser: parserAstro,
|
|
1883
1788
|
parserOptions: {
|
|
1884
1789
|
extraFileExtensions: [".astro"],
|
|
1885
|
-
parser:
|
|
1886
|
-
|
|
1887
|
-
|
|
1790
|
+
parser: parserTs
|
|
1791
|
+
},
|
|
1792
|
+
sourceType: "module"
|
|
1888
1793
|
},
|
|
1794
|
+
processor: "astro/client-side-ts",
|
|
1889
1795
|
rules: {
|
|
1890
|
-
|
|
1891
|
-
// https://ota-meshi.github.io/eslint-plugin-astro/rules/no-conflict-set-directives/
|
|
1796
|
+
"astro/missing-client-only-directive-value": "error",
|
|
1892
1797
|
"astro/no-conflict-set-directives": "error",
|
|
1893
|
-
|
|
1894
|
-
|
|
1798
|
+
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
1799
|
+
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
1800
|
+
"astro/no-deprecated-astro-resolve": "error",
|
|
1801
|
+
"astro/no-deprecated-getentrybyslug": "error",
|
|
1895
1802
|
"astro/no-set-html-directive": "off",
|
|
1803
|
+
"astro/no-unused-define-vars-in-style": "error",
|
|
1804
|
+
"astro/semi": "error",
|
|
1805
|
+
"astro/valid-compile": "error",
|
|
1896
1806
|
...stylistic2 ? {
|
|
1897
1807
|
"style/indent": "off",
|
|
1898
|
-
"style/jsx-indent": "off",
|
|
1899
1808
|
"style/jsx-closing-tag-location": "off",
|
|
1809
|
+
"style/jsx-indent": "off",
|
|
1900
1810
|
"style/jsx-one-expression-per-line": "off",
|
|
1901
1811
|
"style/no-multiple-empty-lines": "off"
|
|
1902
1812
|
} : {},
|
|
1903
1813
|
...overrides
|
|
1904
1814
|
}
|
|
1905
|
-
},
|
|
1906
|
-
{
|
|
1907
|
-
name: "luxass/astro/scripts-js",
|
|
1908
|
-
files: [
|
|
1909
|
-
"**/*.astro/*.js",
|
|
1910
|
-
"*.astro/*.js"
|
|
1911
|
-
],
|
|
1912
|
-
languageOptions: {
|
|
1913
|
-
globals: {
|
|
1914
|
-
browser: true,
|
|
1915
|
-
es2020: true
|
|
1916
|
-
},
|
|
1917
|
-
parserOptions: {
|
|
1918
|
-
sourceType: "module"
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
},
|
|
1922
|
-
{
|
|
1923
|
-
name: "luxass/astro/scripts-ts",
|
|
1924
|
-
files: [
|
|
1925
|
-
"**/*.astro/*.ts",
|
|
1926
|
-
"*.astro/*.ts"
|
|
1927
|
-
],
|
|
1928
|
-
languageOptions: {
|
|
1929
|
-
globals: {
|
|
1930
|
-
browser: true,
|
|
1931
|
-
es2020: true
|
|
1932
|
-
},
|
|
1933
|
-
parser: typescript2 ? parserTs : null,
|
|
1934
|
-
parserOptions: {
|
|
1935
|
-
project: null,
|
|
1936
|
-
sourceType: "module"
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
1815
|
}
|
|
1940
1816
|
];
|
|
1941
1817
|
}
|
|
@@ -2239,83 +2115,6 @@ async function toml(options = {}) {
|
|
|
2239
2115
|
];
|
|
2240
2116
|
}
|
|
2241
2117
|
|
|
2242
|
-
// src/configs/solid.ts
|
|
2243
|
-
async function solid(options = {}) {
|
|
2244
|
-
const {
|
|
2245
|
-
overrides = {},
|
|
2246
|
-
typescript: typescript2 = true,
|
|
2247
|
-
files = [GLOB_JSX, GLOB_TSX]
|
|
2248
|
-
} = options;
|
|
2249
|
-
await ensure([
|
|
2250
|
-
"eslint-plugin-solid"
|
|
2251
|
-
]);
|
|
2252
|
-
const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
|
|
2253
|
-
const isTypeAware = !!tsconfigPath;
|
|
2254
|
-
const [
|
|
2255
|
-
pluginSolid,
|
|
2256
|
-
parserTs
|
|
2257
|
-
] = await Promise.all([
|
|
2258
|
-
interop(import("eslint-plugin-solid")),
|
|
2259
|
-
interop(import("@typescript-eslint/parser"))
|
|
2260
|
-
]);
|
|
2261
|
-
return [
|
|
2262
|
-
{
|
|
2263
|
-
name: "luxass/solid/setup",
|
|
2264
|
-
plugins: {
|
|
2265
|
-
solid: pluginSolid
|
|
2266
|
-
}
|
|
2267
|
-
},
|
|
2268
|
-
{
|
|
2269
|
-
name: "luxass/solid/rules",
|
|
2270
|
-
files,
|
|
2271
|
-
languageOptions: {
|
|
2272
|
-
parser: parserTs,
|
|
2273
|
-
parserOptions: {
|
|
2274
|
-
ecmaFeatures: {
|
|
2275
|
-
jsx: true
|
|
2276
|
-
},
|
|
2277
|
-
...isTypeAware ? { project: tsconfigPath } : {}
|
|
2278
|
-
},
|
|
2279
|
-
sourceType: "module"
|
|
2280
|
-
},
|
|
2281
|
-
rules: {
|
|
2282
|
-
// reactivity
|
|
2283
|
-
"solid/components-return-once": "warn",
|
|
2284
|
-
"solid/event-handlers": ["error", {
|
|
2285
|
-
// if true, don't warn on ambiguously named event handlers like `onclick` or `onchange`
|
|
2286
|
-
ignoreCase: false,
|
|
2287
|
-
// if true, warn when spreading event handlers onto JSX. Enable for Solid < v1.6.
|
|
2288
|
-
warnOnSpread: false
|
|
2289
|
-
}],
|
|
2290
|
-
// these rules are mostly style suggestions
|
|
2291
|
-
"solid/imports": "error",
|
|
2292
|
-
// identifier usage is important
|
|
2293
|
-
"solid/jsx-no-duplicate-props": "error",
|
|
2294
|
-
"solid/jsx-no-script-url": "error",
|
|
2295
|
-
"solid/jsx-no-undef": "error",
|
|
2296
|
-
"solid/jsx-uses-vars": "error",
|
|
2297
|
-
"solid/no-destructure": "error",
|
|
2298
|
-
// security problems
|
|
2299
|
-
"solid/no-innerhtml": ["error", { allowStatic: true }],
|
|
2300
|
-
"solid/no-react-deps": "error",
|
|
2301
|
-
"solid/no-react-specific-props": "error",
|
|
2302
|
-
"solid/no-unknown-namespaces": "error",
|
|
2303
|
-
"solid/prefer-for": "error",
|
|
2304
|
-
"solid/reactivity": "warn",
|
|
2305
|
-
"solid/self-closing-comp": "error",
|
|
2306
|
-
"solid/style-prop": ["error", { styleProps: ["style", "css"] }],
|
|
2307
|
-
...typescript2 ? {
|
|
2308
|
-
"solid/jsx-no-undef": ["error", { typescriptEnabled: true }],
|
|
2309
|
-
// namespaces taken care of by TS
|
|
2310
|
-
"solid/no-unknown-namespaces": "off"
|
|
2311
|
-
} : {},
|
|
2312
|
-
// overrides
|
|
2313
|
-
...overrides
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
];
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
2118
|
// src/configs/regexp.ts
|
|
2320
2119
|
import { configs } from "eslint-plugin-regexp";
|
|
2321
2120
|
async function regexp(options = {}) {
|
|
@@ -2342,6 +2141,23 @@ async function regexp(options = {}) {
|
|
|
2342
2141
|
];
|
|
2343
2142
|
}
|
|
2344
2143
|
|
|
2144
|
+
// src/configs/jsx.ts
|
|
2145
|
+
async function jsx() {
|
|
2146
|
+
return [
|
|
2147
|
+
{
|
|
2148
|
+
name: "luxass/jsx/setup",
|
|
2149
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
2150
|
+
languageOptions: {
|
|
2151
|
+
parserOptions: {
|
|
2152
|
+
ecmaFeatures: {
|
|
2153
|
+
jsx: true
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
];
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2345
2161
|
// src/factory.ts
|
|
2346
2162
|
var FLAT_CONFIG_PROPS = [
|
|
2347
2163
|
"name",
|
|
@@ -2376,21 +2192,20 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2376
2192
|
const {
|
|
2377
2193
|
astro: enableAstro = false,
|
|
2378
2194
|
autoRenamePlugins = true,
|
|
2379
|
-
editor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
|
|
2380
2195
|
exts = [],
|
|
2381
2196
|
gitignore: enableGitignore = true,
|
|
2197
|
+
editor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
|
|
2198
|
+
jsx: enableJsx = true,
|
|
2382
2199
|
react: enableReact = false,
|
|
2383
|
-
|
|
2384
|
-
svelte: enableSvelte = false,
|
|
2385
|
-
solid: enableSolid = false,
|
|
2200
|
+
regexp: enableRegexp = true,
|
|
2386
2201
|
typescript: enableTypeScript = isPackageExists4("typescript"),
|
|
2387
2202
|
unocss: enableUnoCSS = false,
|
|
2388
|
-
|
|
2203
|
+
tailwindcss: enableTailwindCSS = false,
|
|
2389
2204
|
vue: enableVue = VuePackages.some((i) => isPackageExists4(i))
|
|
2390
2205
|
} = options;
|
|
2391
2206
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
2392
2207
|
if (stylisticOptions && !("jsx" in stylisticOptions)) {
|
|
2393
|
-
stylisticOptions.jsx =
|
|
2208
|
+
stylisticOptions.jsx = enableJsx;
|
|
2394
2209
|
}
|
|
2395
2210
|
const configs2 = [];
|
|
2396
2211
|
if (enableGitignore) {
|
|
@@ -2402,6 +2217,8 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2402
2217
|
}
|
|
2403
2218
|
}
|
|
2404
2219
|
}
|
|
2220
|
+
const typescriptOptions = resolveSubOptions(options, "typescript");
|
|
2221
|
+
const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
|
|
2405
2222
|
configs2.push(
|
|
2406
2223
|
ignores(),
|
|
2407
2224
|
javascript({
|
|
@@ -2421,9 +2238,12 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2421
2238
|
if (enableVue) {
|
|
2422
2239
|
exts.push("vue");
|
|
2423
2240
|
}
|
|
2241
|
+
if (enableJsx) {
|
|
2242
|
+
configs2.push(jsx());
|
|
2243
|
+
}
|
|
2424
2244
|
if (enableTypeScript) {
|
|
2425
2245
|
configs2.push(typescript({
|
|
2426
|
-
...
|
|
2246
|
+
...typescriptOptions,
|
|
2427
2247
|
exts,
|
|
2428
2248
|
overrides: getOverrides(options, "typescript")
|
|
2429
2249
|
}));
|
|
@@ -2450,28 +2270,9 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2450
2270
|
configs2.push(react({
|
|
2451
2271
|
...resolveSubOptions(options, "react"),
|
|
2452
2272
|
overrides: getOverrides(options, "react"),
|
|
2453
|
-
tsconfigPath
|
|
2273
|
+
tsconfigPath
|
|
2454
2274
|
}));
|
|
2455
2275
|
}
|
|
2456
|
-
if (enableSolid) {
|
|
2457
|
-
configs2.push(
|
|
2458
|
-
solid({
|
|
2459
|
-
...resolveSubOptions(options, "solid"),
|
|
2460
|
-
overrides: getOverrides(options, "solid"),
|
|
2461
|
-
typescript: !!enableTypeScript
|
|
2462
|
-
})
|
|
2463
|
-
);
|
|
2464
|
-
}
|
|
2465
|
-
if (enableSvelte) {
|
|
2466
|
-
configs2.push(
|
|
2467
|
-
svelte({
|
|
2468
|
-
...resolveSubOptions(options, "svelte"),
|
|
2469
|
-
overrides: getOverrides(options, "svelte"),
|
|
2470
|
-
stylistic: stylisticOptions,
|
|
2471
|
-
typescript: !!enableTypeScript
|
|
2472
|
-
})
|
|
2473
|
-
);
|
|
2474
|
-
}
|
|
2475
2276
|
if (enableVue) {
|
|
2476
2277
|
configs2.push(
|
|
2477
2278
|
vue({
|
|
@@ -2486,8 +2287,7 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2486
2287
|
configs2.push(
|
|
2487
2288
|
astro({
|
|
2488
2289
|
...resolveSubOptions(options, "astro"),
|
|
2489
|
-
overrides: getOverrides(options, "astro")
|
|
2490
|
-
typescript: !!enableTypeScript
|
|
2290
|
+
overrides: getOverrides(options, "astro")
|
|
2491
2291
|
})
|
|
2492
2292
|
);
|
|
2493
2293
|
}
|
|
@@ -2603,6 +2403,7 @@ export {
|
|
|
2603
2403
|
javascript,
|
|
2604
2404
|
jsdoc,
|
|
2605
2405
|
jsonc,
|
|
2406
|
+
jsx,
|
|
2606
2407
|
luxass,
|
|
2607
2408
|
markdown,
|
|
2608
2409
|
node,
|
|
@@ -2611,11 +2412,9 @@ export {
|
|
|
2611
2412
|
regexp,
|
|
2612
2413
|
renameRules,
|
|
2613
2414
|
resolveSubOptions,
|
|
2614
|
-
solid,
|
|
2615
2415
|
sortPackageJson,
|
|
2616
2416
|
sortTsconfig,
|
|
2617
2417
|
stylistic,
|
|
2618
|
-
svelte,
|
|
2619
2418
|
tailwindcss,
|
|
2620
2419
|
test,
|
|
2621
2420
|
toArray,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "ESLint config for @luxass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"email": "lucasnrgaard@gmail.com",
|
|
9
9
|
"url": "https://luxass.dev"
|
|
10
10
|
},
|
|
11
|
-
"packageManager": "pnpm@9.
|
|
11
|
+
"packageManager": "pnpm@9.2.0",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
@@ -56,11 +56,8 @@
|
|
|
56
56
|
"eslint-plugin-format": ">=0.1.0",
|
|
57
57
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
58
58
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
59
|
-
"eslint-plugin-solid": "^0.14.0",
|
|
60
|
-
"eslint-plugin-svelte": ">=2.37.0",
|
|
61
59
|
"eslint-plugin-tailwindcss": "^3.17.0",
|
|
62
|
-
"prettier-plugin-astro": "^0.14.0"
|
|
63
|
-
"svelte-eslint-parser": "^0.36.0"
|
|
60
|
+
"prettier-plugin-astro": "^0.14.0"
|
|
64
61
|
},
|
|
65
62
|
"peerDependenciesMeta": {
|
|
66
63
|
"@unocss/eslint-plugin": {
|
|
@@ -72,9 +69,6 @@
|
|
|
72
69
|
"eslint-plugin-astro": {
|
|
73
70
|
"optional": true
|
|
74
71
|
},
|
|
75
|
-
"eslint-plugin-solid": {
|
|
76
|
-
"optional": true
|
|
77
|
-
},
|
|
78
72
|
"eslint-plugin-format": {
|
|
79
73
|
"optional": true
|
|
80
74
|
},
|
|
@@ -92,12 +86,6 @@
|
|
|
92
86
|
},
|
|
93
87
|
"eslint-plugin-tailwindcss": {
|
|
94
88
|
"optional": true
|
|
95
|
-
},
|
|
96
|
-
"svelte-eslint-parser": {
|
|
97
|
-
"optional": true
|
|
98
|
-
},
|
|
99
|
-
"eslint-plugin-svelte": {
|
|
100
|
-
"optional": true
|
|
101
89
|
}
|
|
102
90
|
},
|
|
103
91
|
"dependencies": {
|
|
@@ -105,17 +93,17 @@
|
|
|
105
93
|
"@clack/prompts": "^0.7.0",
|
|
106
94
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
107
95
|
"@stylistic/eslint-plugin": "^2.1.0",
|
|
108
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
109
|
-
"@typescript-eslint/parser": "^7.
|
|
96
|
+
"@typescript-eslint/eslint-plugin": "^7.12.0",
|
|
97
|
+
"@typescript-eslint/parser": "^7.12.0",
|
|
110
98
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
111
99
|
"eslint-flat-config-utils": "^0.2.5",
|
|
112
100
|
"eslint-merge-processors": "^0.1.0",
|
|
113
101
|
"eslint-plugin-antfu": "^2.3.3",
|
|
114
102
|
"eslint-plugin-import-x": "^0.5.1",
|
|
115
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
103
|
+
"eslint-plugin-jsdoc": "^48.2.9",
|
|
116
104
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
117
105
|
"eslint-plugin-markdown": "^5.0.0",
|
|
118
|
-
"eslint-plugin-n": "^17.
|
|
106
|
+
"eslint-plugin-n": "^17.8.1",
|
|
119
107
|
"eslint-plugin-regexp": "^2.6.0",
|
|
120
108
|
"eslint-plugin-toml": "^0.11.0",
|
|
121
109
|
"eslint-plugin-unicorn": "^53.0.0",
|
|
@@ -124,7 +112,7 @@
|
|
|
124
112
|
"eslint-plugin-vue": "^9.26.0",
|
|
125
113
|
"eslint-plugin-yml": "^1.14.0",
|
|
126
114
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
127
|
-
"globals": "^15.
|
|
115
|
+
"globals": "^15.4.0",
|
|
128
116
|
"jsonc-eslint-parser": "^2.4.0",
|
|
129
117
|
"local-pkg": "^0.5.0",
|
|
130
118
|
"parse-gitignore": "^2.0.0",
|
|
@@ -133,31 +121,27 @@
|
|
|
133
121
|
"yaml-eslint-parser": "^1.2.3"
|
|
134
122
|
},
|
|
135
123
|
"devDependencies": {
|
|
136
|
-
"@eslint-react/eslint-plugin": "^1.5.
|
|
124
|
+
"@eslint-react/eslint-plugin": "^1.5.15",
|
|
137
125
|
"@eslint/config-inspector": "^0.4.10",
|
|
138
126
|
"@stylistic/eslint-plugin-migrate": "^2.1.0",
|
|
139
127
|
"@types/eslint": "^8.56.10",
|
|
140
128
|
"@types/estree": "^1.0.5",
|
|
141
129
|
"@types/node": "^20.12.7",
|
|
142
|
-
"@typescript-eslint/rule-tester": "^7.
|
|
143
|
-
"@unocss/eslint-plugin": "^0.60.
|
|
130
|
+
"@typescript-eslint/rule-tester": "^7.12.0",
|
|
131
|
+
"@unocss/eslint-plugin": "^0.60.4",
|
|
144
132
|
"astro-eslint-parser": "^1.0.2",
|
|
145
133
|
"eslint": "npm:eslint-ts-patch@9.2.0-6",
|
|
146
134
|
"eslint-plugin-astro": "^1.2.0",
|
|
147
135
|
"eslint-plugin-format": "^0.1.1",
|
|
148
136
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
149
137
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
150
|
-
"eslint-plugin-
|
|
151
|
-
"eslint-plugin-svelte": "^2.39.0",
|
|
152
|
-
"eslint-plugin-tailwindcss": "^3.17.0",
|
|
138
|
+
"eslint-plugin-tailwindcss": "^3.17.3",
|
|
153
139
|
"eslint-typegen": "^0.2.4",
|
|
154
140
|
"lint-staged": "^15.2.5",
|
|
155
141
|
"prettier-plugin-astro": "^0.14.0",
|
|
156
142
|
"simple-git-hooks": "^2.11.1",
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"tsup": "^8.0.2",
|
|
160
|
-
"tsx": "^4.11.0",
|
|
143
|
+
"tsup": "^8.1.0",
|
|
144
|
+
"tsx": "^4.14.0",
|
|
161
145
|
"typescript": "^5.4.5",
|
|
162
146
|
"vitest": "^1.6.0",
|
|
163
147
|
"vue": "^3.4.27"
|