@luxass/eslint-config 4.15.0 → 4.17.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/dist/index.cjs +120 -82
- package/dist/index.d.cts +1706 -697
- package/dist/index.d.ts +1706 -697
- package/dist/index.js +116 -78
- package/package.json +61 -65
package/dist/index.cjs
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
GLOB_ASTRO: () => GLOB_ASTRO,
|
|
34
34
|
GLOB_ASTRO_TS: () => GLOB_ASTRO_TS,
|
|
35
35
|
GLOB_CSS: () => GLOB_CSS,
|
|
@@ -62,7 +62,7 @@ __export(src_exports, {
|
|
|
62
62
|
astro: () => astro,
|
|
63
63
|
combine: () => combine,
|
|
64
64
|
comments: () => comments,
|
|
65
|
-
default: () =>
|
|
65
|
+
default: () => index_default,
|
|
66
66
|
disables: () => disables,
|
|
67
67
|
ensure: () => ensure,
|
|
68
68
|
formatters: () => formatters,
|
|
@@ -100,9 +100,9 @@ __export(src_exports, {
|
|
|
100
100
|
vue: () => vue,
|
|
101
101
|
yaml: () => yaml
|
|
102
102
|
});
|
|
103
|
-
module.exports = __toCommonJS(
|
|
103
|
+
module.exports = __toCommonJS(index_exports);
|
|
104
104
|
|
|
105
|
-
// node_modules/.pnpm/tsup@8.
|
|
105
|
+
// node_modules/.pnpm/tsup@8.4.0_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
|
|
106
106
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
107
107
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
108
108
|
|
|
@@ -332,7 +332,6 @@ async function astro(options = {}) {
|
|
|
332
332
|
}
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
|
-
name: "luxass/astro/rules",
|
|
336
335
|
files,
|
|
337
336
|
languageOptions: {
|
|
338
337
|
globals: pluginAstro.environments.astro.globals,
|
|
@@ -343,6 +342,7 @@ async function astro(options = {}) {
|
|
|
343
342
|
},
|
|
344
343
|
sourceType: "module"
|
|
345
344
|
},
|
|
345
|
+
name: "luxass/astro/rules",
|
|
346
346
|
processor: "astro/client-side-ts",
|
|
347
347
|
rules: {
|
|
348
348
|
// Astro uses top level await for e.g. data fetching
|
|
@@ -440,8 +440,8 @@ async function disables() {
|
|
|
440
440
|
}
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
|
-
name: "luxass/disables/github-actions",
|
|
444
443
|
files: ["**/.github/workflows/*.{yml,yaml}"],
|
|
444
|
+
name: "luxass/disables/github-actions",
|
|
445
445
|
rules: {
|
|
446
446
|
// GitHub Actions supports empty values to enable features
|
|
447
447
|
"yaml/no-empty-mapping-value": "off"
|
|
@@ -480,7 +480,6 @@ async function stylistic(options = {}) {
|
|
|
480
480
|
};
|
|
481
481
|
const pluginStylistic = await interop(import("@stylistic/eslint-plugin"));
|
|
482
482
|
const config = pluginStylistic.configs.customize({
|
|
483
|
-
flat: true,
|
|
484
483
|
indent,
|
|
485
484
|
jsx: jsx2,
|
|
486
485
|
pluginName: "style",
|
|
@@ -502,6 +501,8 @@ async function stylistic(options = {}) {
|
|
|
502
501
|
"curly": ["error", "multi-line", "consistent"],
|
|
503
502
|
"style/arrow-parens": ["error", "always", { requireForBlockBody: true }],
|
|
504
503
|
"style/brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
|
504
|
+
"style/generator-star-spacing": ["error", { after: true, before: false }],
|
|
505
|
+
"style/yield-star-spacing": ["error", { after: true, before: false }],
|
|
505
506
|
...overrides
|
|
506
507
|
}
|
|
507
508
|
}
|
|
@@ -573,11 +574,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
573
574
|
if (options.css) {
|
|
574
575
|
configs2.push(
|
|
575
576
|
{
|
|
576
|
-
name: "luxass/formatter/css",
|
|
577
577
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
578
578
|
languageOptions: {
|
|
579
579
|
parser: parserPlain
|
|
580
580
|
},
|
|
581
|
+
name: "luxass/formatter/css",
|
|
581
582
|
rules: {
|
|
582
583
|
"format/prettier": [
|
|
583
584
|
"error",
|
|
@@ -588,11 +589,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
588
589
|
}
|
|
589
590
|
},
|
|
590
591
|
{
|
|
591
|
-
name: "luxass/formatter/scss",
|
|
592
592
|
files: [GLOB_SCSS],
|
|
593
593
|
languageOptions: {
|
|
594
594
|
parser: parserPlain
|
|
595
595
|
},
|
|
596
|
+
name: "luxass/formatter/scss",
|
|
596
597
|
rules: {
|
|
597
598
|
"format/prettier": [
|
|
598
599
|
"error",
|
|
@@ -603,11 +604,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
603
604
|
}
|
|
604
605
|
},
|
|
605
606
|
{
|
|
606
|
-
name: "luxass/formatter/less",
|
|
607
607
|
files: [GLOB_LESS],
|
|
608
608
|
languageOptions: {
|
|
609
609
|
parser: parserPlain
|
|
610
610
|
},
|
|
611
|
+
name: "luxass/formatter/less",
|
|
611
612
|
rules: {
|
|
612
613
|
"format/prettier": [
|
|
613
614
|
"error",
|
|
@@ -621,11 +622,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
621
622
|
}
|
|
622
623
|
if (options.html) {
|
|
623
624
|
configs2.push({
|
|
624
|
-
name: "luxass/formatter/html",
|
|
625
625
|
files: [GLOB_HTML],
|
|
626
626
|
languageOptions: {
|
|
627
627
|
parser: parserPlain
|
|
628
628
|
},
|
|
629
|
+
name: "luxass/formatter/html",
|
|
629
630
|
rules: {
|
|
630
631
|
"format/prettier": [
|
|
631
632
|
"error",
|
|
@@ -639,11 +640,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
639
640
|
if (options.markdown) {
|
|
640
641
|
const formatter = options.markdown === true ? "prettier" : options.markdown;
|
|
641
642
|
configs2.push({
|
|
642
|
-
name: "luxass/formatter/markdown",
|
|
643
643
|
files: [GLOB_MARKDOWN],
|
|
644
644
|
languageOptions: {
|
|
645
645
|
parser: parserPlain
|
|
646
646
|
},
|
|
647
|
+
name: "luxass/formatter/markdown",
|
|
647
648
|
rules: {
|
|
648
649
|
[`format/${formatter}`]: [
|
|
649
650
|
"error",
|
|
@@ -660,11 +661,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
660
661
|
}
|
|
661
662
|
if (options.astro) {
|
|
662
663
|
configs2.push({
|
|
663
|
-
name: "luxass/formatter/astro",
|
|
664
664
|
files: [GLOB_ASTRO],
|
|
665
665
|
languageOptions: {
|
|
666
666
|
parser: parserPlain
|
|
667
667
|
},
|
|
668
|
+
name: "luxass/formatter/astro",
|
|
668
669
|
rules: {
|
|
669
670
|
"format/prettier": [
|
|
670
671
|
"error",
|
|
@@ -680,11 +681,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
680
681
|
}
|
|
681
682
|
if (options.graphql) {
|
|
682
683
|
configs2.push({
|
|
683
|
-
name: "luxass/formatter/graphql",
|
|
684
684
|
files: [GLOB_GRAPHQL],
|
|
685
685
|
languageOptions: {
|
|
686
686
|
parser: parserPlain
|
|
687
687
|
},
|
|
688
|
+
name: "luxass/formatter/graphql",
|
|
688
689
|
rules: {
|
|
689
690
|
"format/prettier": [
|
|
690
691
|
"error",
|
|
@@ -729,6 +730,7 @@ async function imports(options = {}) {
|
|
|
729
730
|
"antfu/import-dedupe": "error",
|
|
730
731
|
"antfu/no-import-dist": "error",
|
|
731
732
|
"antfu/no-import-node-modules-by-path": "error",
|
|
733
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
732
734
|
"import/first": "error",
|
|
733
735
|
"import/no-duplicates": "error",
|
|
734
736
|
"import/no-mutable-exports": "error",
|
|
@@ -754,7 +756,6 @@ async function javascript(options = {}) {
|
|
|
754
756
|
} = options;
|
|
755
757
|
return [
|
|
756
758
|
{
|
|
757
|
-
name: "luxass/javascript/setup",
|
|
758
759
|
languageOptions: {
|
|
759
760
|
ecmaVersion: 2022,
|
|
760
761
|
globals: {
|
|
@@ -776,7 +777,8 @@ async function javascript(options = {}) {
|
|
|
776
777
|
},
|
|
777
778
|
linterOptions: {
|
|
778
779
|
reportUnusedDisableDirectives: true
|
|
779
|
-
}
|
|
780
|
+
},
|
|
781
|
+
name: "luxass/javascript/setup"
|
|
780
782
|
},
|
|
781
783
|
{
|
|
782
784
|
name: "luxass/javascript/rules",
|
|
@@ -852,8 +854,8 @@ async function javascript(options = {}) {
|
|
|
852
854
|
"no-regex-spaces": "error",
|
|
853
855
|
"no-restricted-globals": [
|
|
854
856
|
"error",
|
|
855
|
-
{
|
|
856
|
-
{
|
|
857
|
+
{ message: "Use `globalThis` instead.", name: "global" },
|
|
858
|
+
{ message: "Use `globalThis` instead.", name: "self" }
|
|
857
859
|
],
|
|
858
860
|
"no-restricted-properties": [
|
|
859
861
|
"error",
|
|
@@ -985,12 +987,12 @@ async function javascript(options = {}) {
|
|
|
985
987
|
}
|
|
986
988
|
},
|
|
987
989
|
{
|
|
988
|
-
name: "luxass/disables/cli",
|
|
989
990
|
files: [
|
|
990
991
|
`scripts/${GLOB_SRC}`,
|
|
991
992
|
`cli.${GLOB_SRC_EXT}`,
|
|
992
993
|
`**/playground.${GLOB_SRC_EXT}`
|
|
993
994
|
],
|
|
995
|
+
name: "luxass/disables/cli",
|
|
994
996
|
rules: {
|
|
995
997
|
"no-console": "off"
|
|
996
998
|
}
|
|
@@ -1061,11 +1063,11 @@ async function jsonc(options = {}) {
|
|
|
1061
1063
|
}
|
|
1062
1064
|
},
|
|
1063
1065
|
{
|
|
1064
|
-
name: "luxass/jsonc/rules",
|
|
1065
1066
|
files,
|
|
1066
1067
|
languageOptions: {
|
|
1067
1068
|
parser: parserJsonc
|
|
1068
1069
|
},
|
|
1070
|
+
name: "luxass/jsonc/rules",
|
|
1069
1071
|
rules: {
|
|
1070
1072
|
"jsonc/no-bigint-literals": "error",
|
|
1071
1073
|
"jsonc/no-binary-expression": "error",
|
|
@@ -1124,7 +1126,6 @@ async function jsonc(options = {}) {
|
|
|
1124
1126
|
async function jsx() {
|
|
1125
1127
|
return [
|
|
1126
1128
|
{
|
|
1127
|
-
name: "luxass/jsx/setup",
|
|
1128
1129
|
files: [GLOB_JSX, GLOB_TSX],
|
|
1129
1130
|
languageOptions: {
|
|
1130
1131
|
parserOptions: {
|
|
@@ -1132,7 +1133,8 @@ async function jsx() {
|
|
|
1132
1133
|
jsx: true
|
|
1133
1134
|
}
|
|
1134
1135
|
}
|
|
1135
|
-
}
|
|
1136
|
+
},
|
|
1137
|
+
name: "luxass/jsx/setup"
|
|
1136
1138
|
}
|
|
1137
1139
|
];
|
|
1138
1140
|
}
|
|
@@ -1154,9 +1156,9 @@ async function markdown(options = {}) {
|
|
|
1154
1156
|
}
|
|
1155
1157
|
},
|
|
1156
1158
|
{
|
|
1157
|
-
name: "luxass/markdown/processor",
|
|
1158
1159
|
files,
|
|
1159
1160
|
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
1161
|
+
name: "luxass/markdown/processor",
|
|
1160
1162
|
// `eslint-plugin-markdown` only creates virtual files for code blocks,
|
|
1161
1163
|
// but not the markdown file itself. We use `eslint-merge-processors` to
|
|
1162
1164
|
// add a pass-through processor for the markdown file itself.
|
|
@@ -1166,14 +1168,13 @@ async function markdown(options = {}) {
|
|
|
1166
1168
|
])
|
|
1167
1169
|
},
|
|
1168
1170
|
{
|
|
1169
|
-
name: "luxass/markdown/parser",
|
|
1170
1171
|
files,
|
|
1171
1172
|
languageOptions: {
|
|
1172
1173
|
parser: parserPlain
|
|
1173
|
-
}
|
|
1174
|
+
},
|
|
1175
|
+
name: "luxass/markdown/parser"
|
|
1174
1176
|
},
|
|
1175
1177
|
{
|
|
1176
|
-
name: "luxass/markdown/disables",
|
|
1177
1178
|
files: [
|
|
1178
1179
|
GLOB_MARKDOWN_CODE,
|
|
1179
1180
|
...exts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
@@ -1185,6 +1186,7 @@ async function markdown(options = {}) {
|
|
|
1185
1186
|
}
|
|
1186
1187
|
}
|
|
1187
1188
|
},
|
|
1189
|
+
name: "luxass/markdown/disables",
|
|
1188
1190
|
rules: {
|
|
1189
1191
|
"antfu/no-top-level-await": "off",
|
|
1190
1192
|
"import/newline-after-import": "off",
|
|
@@ -1298,12 +1300,12 @@ var NextJsPackages = [
|
|
|
1298
1300
|
async function react(options = {}) {
|
|
1299
1301
|
const {
|
|
1300
1302
|
files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
|
|
1301
|
-
overrides = {},
|
|
1302
1303
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
1303
1304
|
ignoresTypeAware = [
|
|
1304
1305
|
`${GLOB_MARKDOWN}/**`,
|
|
1305
1306
|
GLOB_ASTRO_TS
|
|
1306
1307
|
],
|
|
1308
|
+
overrides = {},
|
|
1307
1309
|
tsconfigPath
|
|
1308
1310
|
} = options;
|
|
1309
1311
|
await ensure([
|
|
@@ -1343,7 +1345,6 @@ async function react(options = {}) {
|
|
|
1343
1345
|
}
|
|
1344
1346
|
},
|
|
1345
1347
|
{
|
|
1346
|
-
name: "luxass/react/rules",
|
|
1347
1348
|
files,
|
|
1348
1349
|
languageOptions: {
|
|
1349
1350
|
parserOptions: {
|
|
@@ -1353,6 +1354,7 @@ async function react(options = {}) {
|
|
|
1353
1354
|
},
|
|
1354
1355
|
sourceType: "module"
|
|
1355
1356
|
},
|
|
1357
|
+
name: "luxass/react/rules",
|
|
1356
1358
|
rules: {
|
|
1357
1359
|
// recommended rules from @eslint-react/dom
|
|
1358
1360
|
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
@@ -1492,8 +1494,8 @@ async function regexp(options = {}) {
|
|
|
1492
1494
|
function sortPackageJson() {
|
|
1493
1495
|
return [
|
|
1494
1496
|
{
|
|
1495
|
-
name: "luxass/sort/package-json",
|
|
1496
1497
|
files: ["**/package.json"],
|
|
1498
|
+
name: "luxass/sort/package-json",
|
|
1497
1499
|
rules: {
|
|
1498
1500
|
"jsonc/sort-array-values": [
|
|
1499
1501
|
"error",
|
|
@@ -1593,8 +1595,8 @@ function sortPackageJson() {
|
|
|
1593
1595
|
function sortTsconfig() {
|
|
1594
1596
|
return [
|
|
1595
1597
|
{
|
|
1596
|
-
name: "luxass/sort/tsconfig",
|
|
1597
1598
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
1599
|
+
name: "luxass/sort/tsconfig",
|
|
1598
1600
|
rules: {
|
|
1599
1601
|
"jsonc/sort-keys": [
|
|
1600
1602
|
"error",
|
|
@@ -1720,8 +1722,8 @@ function sortTsconfig() {
|
|
|
1720
1722
|
// src/configs/tailwindcss.ts
|
|
1721
1723
|
async function tailwindcss(options = {}) {
|
|
1722
1724
|
const {
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
+
configPath,
|
|
1726
|
+
overrides
|
|
1725
1727
|
} = options;
|
|
1726
1728
|
await ensure([
|
|
1727
1729
|
"eslint-plugin-tailwindcss"
|
|
@@ -1733,7 +1735,6 @@ async function tailwindcss(options = {}) {
|
|
|
1733
1735
|
]);
|
|
1734
1736
|
return [
|
|
1735
1737
|
{
|
|
1736
|
-
name: "luxass/tailwindcss",
|
|
1737
1738
|
languageOptions: {
|
|
1738
1739
|
parserOptions: {
|
|
1739
1740
|
ecmaFeatures: {
|
|
@@ -1741,13 +1742,7 @@ async function tailwindcss(options = {}) {
|
|
|
1741
1742
|
}
|
|
1742
1743
|
}
|
|
1743
1744
|
},
|
|
1744
|
-
|
|
1745
|
-
...configPath != null ? {
|
|
1746
|
-
tailwindcss: {
|
|
1747
|
-
config: configPath
|
|
1748
|
-
}
|
|
1749
|
-
} : {}
|
|
1750
|
-
},
|
|
1745
|
+
name: "luxass/tailwindcss",
|
|
1751
1746
|
plugins: {
|
|
1752
1747
|
tailwindcss: pluginTailwindCSS
|
|
1753
1748
|
},
|
|
@@ -1767,6 +1762,13 @@ async function tailwindcss(options = {}) {
|
|
|
1767
1762
|
// https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/no-custom-classname.md
|
|
1768
1763
|
"tailwindcss/no-custom-classname": "warn",
|
|
1769
1764
|
...overrides
|
|
1765
|
+
},
|
|
1766
|
+
settings: {
|
|
1767
|
+
...configPath != null ? {
|
|
1768
|
+
tailwindcss: {
|
|
1769
|
+
config: configPath
|
|
1770
|
+
}
|
|
1771
|
+
} : {}
|
|
1770
1772
|
}
|
|
1771
1773
|
}
|
|
1772
1774
|
];
|
|
@@ -1776,8 +1778,8 @@ async function tailwindcss(options = {}) {
|
|
|
1776
1778
|
var _pluginTest;
|
|
1777
1779
|
async function test(options = {}) {
|
|
1778
1780
|
const {
|
|
1779
|
-
isInEditor = false,
|
|
1780
1781
|
files = GLOB_TESTS,
|
|
1782
|
+
isInEditor = false,
|
|
1781
1783
|
overrides = {}
|
|
1782
1784
|
} = options;
|
|
1783
1785
|
const [
|
|
@@ -1794,16 +1796,16 @@ async function test(options = {}) {
|
|
|
1794
1796
|
}
|
|
1795
1797
|
},
|
|
1796
1798
|
{
|
|
1797
|
-
name: "luxass/test/rules",
|
|
1798
1799
|
files,
|
|
1800
|
+
name: "luxass/test/rules",
|
|
1799
1801
|
rules: {
|
|
1800
1802
|
"test/consistent-test-it": [
|
|
1801
1803
|
"error",
|
|
1802
1804
|
{ fn: "it", withinDescribe: "it" }
|
|
1803
1805
|
],
|
|
1806
|
+
"test/no-focused-tests": isInEditor ? "off" : ["error", { fixable: true }],
|
|
1804
1807
|
"test/no-identical-title": "error",
|
|
1805
1808
|
"test/no-import-node-test": "error",
|
|
1806
|
-
"test/no-focused-tests": isInEditor ? "off" : ["error", { fixable: true }],
|
|
1807
1809
|
"test/prefer-hooks-in-order": "error",
|
|
1808
1810
|
"test/prefer-lowercase-title": "error",
|
|
1809
1811
|
// Disables
|
|
@@ -1844,11 +1846,11 @@ async function toml(options = {}) {
|
|
|
1844
1846
|
}
|
|
1845
1847
|
},
|
|
1846
1848
|
{
|
|
1847
|
-
name: "luxass/toml/rules",
|
|
1848
1849
|
files,
|
|
1849
1850
|
languageOptions: {
|
|
1850
1851
|
parser: parserToml
|
|
1851
1852
|
},
|
|
1853
|
+
name: "luxass/toml/rules",
|
|
1852
1854
|
rules: {
|
|
1853
1855
|
"style/spaced-comment": "off",
|
|
1854
1856
|
"toml/comma-style": "error",
|
|
@@ -1885,8 +1887,8 @@ async function typescript(options = {}) {
|
|
|
1885
1887
|
const {
|
|
1886
1888
|
exts = [],
|
|
1887
1889
|
overrides = {},
|
|
1888
|
-
parserOptions = {},
|
|
1889
1890
|
overridesTypeAware = {},
|
|
1891
|
+
parserOptions = {},
|
|
1890
1892
|
type = "app"
|
|
1891
1893
|
} = options ?? {};
|
|
1892
1894
|
const files = options.files ?? [
|
|
@@ -1935,7 +1937,6 @@ async function typescript(options = {}) {
|
|
|
1935
1937
|
return {
|
|
1936
1938
|
files: files2,
|
|
1937
1939
|
...ignores2 ? { ignores: ignores2 } : {},
|
|
1938
|
-
name: `luxass/typescript/${typeAware ? "type-aware-parser" : "parser"}`,
|
|
1939
1940
|
languageOptions: {
|
|
1940
1941
|
parser: parserTs,
|
|
1941
1942
|
parserOptions: {
|
|
@@ -1950,7 +1951,8 @@ async function typescript(options = {}) {
|
|
|
1950
1951
|
} : {},
|
|
1951
1952
|
...parserOptions
|
|
1952
1953
|
}
|
|
1953
|
-
}
|
|
1954
|
+
},
|
|
1955
|
+
name: `luxass/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
1954
1956
|
};
|
|
1955
1957
|
}
|
|
1956
1958
|
return [
|
|
@@ -1967,8 +1969,8 @@ async function typescript(options = {}) {
|
|
|
1967
1969
|
makeParser(false, files, filesTypeAware)
|
|
1968
1970
|
] : [makeParser(false, files)],
|
|
1969
1971
|
{
|
|
1970
|
-
name: "luxass/typescript/rules",
|
|
1971
1972
|
files,
|
|
1973
|
+
name: "luxass/typescript/rules",
|
|
1972
1974
|
rules: {
|
|
1973
1975
|
...renameRules(
|
|
1974
1976
|
pluginTs.configs["eslint-recommended"].overrides[0].rules,
|
|
@@ -1991,14 +1993,18 @@ async function typescript(options = {}) {
|
|
|
1991
1993
|
"ts/ban-ts-comment": [
|
|
1992
1994
|
"error",
|
|
1993
1995
|
{
|
|
1994
|
-
"ts-
|
|
1995
|
-
"ts-
|
|
1996
|
+
"ts-expect-error": "allow-with-description",
|
|
1997
|
+
"ts-ignore": "allow-with-description"
|
|
1996
1998
|
}
|
|
1997
1999
|
],
|
|
1998
2000
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
1999
2001
|
"ts/consistent-type-imports": [
|
|
2000
2002
|
"error",
|
|
2001
|
-
{
|
|
2003
|
+
{
|
|
2004
|
+
disallowTypeAnnotations: false,
|
|
2005
|
+
fixStyle: "separate-type-imports",
|
|
2006
|
+
prefer: "type-imports"
|
|
2007
|
+
}
|
|
2002
2008
|
],
|
|
2003
2009
|
"ts/method-signature-style": ["error", "property"],
|
|
2004
2010
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
@@ -2052,9 +2058,6 @@ async function typescript(options = {}) {
|
|
|
2052
2058
|
// src/configs/unicorn.ts
|
|
2053
2059
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
2054
2060
|
async function unicorn(options = {}) {
|
|
2055
|
-
if (options.allRecommended && import_eslint_plugin_unicorn.default.configs == null) {
|
|
2056
|
-
throw new Error("The `allRecommended` option requires `eslint-plugin-unicorn` to be installed.");
|
|
2057
|
-
}
|
|
2058
2061
|
return [
|
|
2059
2062
|
{
|
|
2060
2063
|
name: "luxass/unicorn/rules",
|
|
@@ -2062,7 +2065,7 @@ async function unicorn(options = {}) {
|
|
|
2062
2065
|
unicorn: import_eslint_plugin_unicorn.default
|
|
2063
2066
|
},
|
|
2064
2067
|
rules: {
|
|
2065
|
-
...options.allRecommended ? import_eslint_plugin_unicorn.default.configs
|
|
2068
|
+
...options.allRecommended ? import_eslint_plugin_unicorn.default.configs.recommended.rules : {
|
|
2066
2069
|
// Pass error message when throwing errors
|
|
2067
2070
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
|
|
2068
2071
|
"unicorn/error-message": "error",
|
|
@@ -2070,8 +2073,8 @@ async function unicorn(options = {}) {
|
|
|
2070
2073
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
|
|
2071
2074
|
"unicorn/escape-case": "error",
|
|
2072
2075
|
// Array.isArray instead of instanceof
|
|
2073
|
-
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-
|
|
2074
|
-
"unicorn/no-instanceof-
|
|
2076
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-builtins.md
|
|
2077
|
+
"unicorn/no-instanceof-builtins": "error",
|
|
2075
2078
|
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
2076
2079
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
|
|
2077
2080
|
"unicorn/no-new-array": "error",
|
|
@@ -2112,9 +2115,9 @@ async function unicorn(options = {}) {
|
|
|
2112
2115
|
async function unocss(options = {}) {
|
|
2113
2116
|
const {
|
|
2114
2117
|
attributify = true,
|
|
2118
|
+
configPath,
|
|
2115
2119
|
overrides,
|
|
2116
|
-
strict = false
|
|
2117
|
-
configPath
|
|
2120
|
+
strict = false
|
|
2118
2121
|
} = options;
|
|
2119
2122
|
await ensure([
|
|
2120
2123
|
"@unocss/eslint-plugin"
|
|
@@ -2130,13 +2133,6 @@ async function unocss(options = {}) {
|
|
|
2130
2133
|
plugins: {
|
|
2131
2134
|
unocss: pluginUnoCSS
|
|
2132
2135
|
},
|
|
2133
|
-
settings: {
|
|
2134
|
-
...configPath != null ? {
|
|
2135
|
-
unocss: {
|
|
2136
|
-
configPath
|
|
2137
|
-
}
|
|
2138
|
-
} : {}
|
|
2139
|
-
},
|
|
2140
2136
|
rules: {
|
|
2141
2137
|
"unocss/order": "warn",
|
|
2142
2138
|
...attributify ? {
|
|
@@ -2146,6 +2142,13 @@ async function unocss(options = {}) {
|
|
|
2146
2142
|
"unocss/blocklist": "error"
|
|
2147
2143
|
} : {},
|
|
2148
2144
|
...overrides
|
|
2145
|
+
},
|
|
2146
|
+
settings: {
|
|
2147
|
+
...configPath != null ? {
|
|
2148
|
+
unocss: {
|
|
2149
|
+
configPath
|
|
2150
|
+
}
|
|
2151
|
+
} : {}
|
|
2149
2152
|
}
|
|
2150
2153
|
}
|
|
2151
2154
|
];
|
|
@@ -2174,7 +2177,6 @@ async function vue(options = {}) {
|
|
|
2174
2177
|
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
2175
2178
|
return [
|
|
2176
2179
|
{
|
|
2177
|
-
name: "luxass/vue/setup",
|
|
2178
2180
|
// This allows Vue plugin to work with auto imports
|
|
2179
2181
|
// https://github.com/vuejs/eslint-plugin-vue/pull/2422
|
|
2180
2182
|
languageOptions: {
|
|
@@ -2195,12 +2197,12 @@ async function vue(options = {}) {
|
|
|
2195
2197
|
watchEffect: "readonly"
|
|
2196
2198
|
}
|
|
2197
2199
|
},
|
|
2200
|
+
name: "luxass/vue/setup",
|
|
2198
2201
|
plugins: {
|
|
2199
2202
|
vue: pluginVue
|
|
2200
2203
|
}
|
|
2201
2204
|
},
|
|
2202
2205
|
{
|
|
2203
|
-
name: "luxass/vue/rules",
|
|
2204
2206
|
files,
|
|
2205
2207
|
languageOptions: {
|
|
2206
2208
|
parser: parserVue,
|
|
@@ -2213,6 +2215,7 @@ async function vue(options = {}) {
|
|
|
2213
2215
|
sourceType: "module"
|
|
2214
2216
|
}
|
|
2215
2217
|
},
|
|
2218
|
+
name: "luxass/vue/rules",
|
|
2216
2219
|
processor: sfcBlocks === false ? pluginVue.processors[".vue"] : (0, import_eslint_merge_processors2.mergeProcessors)([
|
|
2217
2220
|
pluginVue.processors[".vue"],
|
|
2218
2221
|
processorVueBlocks({
|
|
@@ -2225,9 +2228,9 @@ async function vue(options = {}) {
|
|
|
2225
2228
|
]),
|
|
2226
2229
|
rules: {
|
|
2227
2230
|
...pluginVue.configs.base.rules,
|
|
2228
|
-
...pluginVue.configs["
|
|
2229
|
-
...pluginVue.configs["
|
|
2230
|
-
...pluginVue.configs["
|
|
2231
|
+
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
2232
|
+
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
2233
|
+
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
2231
2234
|
"antfu/no-top-level-await": "off",
|
|
2232
2235
|
"node/prefer-global/process": "off",
|
|
2233
2236
|
"ts/explicit-function-return-type": "off",
|
|
@@ -2366,11 +2369,11 @@ async function yaml(options = {}) {
|
|
|
2366
2369
|
}
|
|
2367
2370
|
},
|
|
2368
2371
|
{
|
|
2369
|
-
name: "luxass/yaml/rules",
|
|
2370
2372
|
files,
|
|
2371
2373
|
languageOptions: {
|
|
2372
2374
|
parser: parserYaml
|
|
2373
2375
|
},
|
|
2376
|
+
name: "luxass/yaml/rules",
|
|
2374
2377
|
rules: {
|
|
2375
2378
|
"style/spaced-comment": "off",
|
|
2376
2379
|
"yaml/block-mapping": "error",
|
|
@@ -2396,6 +2399,41 @@ async function yaml(options = {}) {
|
|
|
2396
2399
|
} : {},
|
|
2397
2400
|
...overrides
|
|
2398
2401
|
}
|
|
2402
|
+
},
|
|
2403
|
+
{
|
|
2404
|
+
files: ["pnpm-workspace.yaml"],
|
|
2405
|
+
name: "luxass/yaml/pnpm-workspace",
|
|
2406
|
+
rules: {
|
|
2407
|
+
"yaml/sort-keys": [
|
|
2408
|
+
"error",
|
|
2409
|
+
{
|
|
2410
|
+
order: [
|
|
2411
|
+
"packages",
|
|
2412
|
+
"overrides",
|
|
2413
|
+
"patchedDependencies",
|
|
2414
|
+
"hoistPattern",
|
|
2415
|
+
"catalog",
|
|
2416
|
+
"catalogs",
|
|
2417
|
+
"allowedDeprecatedVersions",
|
|
2418
|
+
"allowNonAppliedPatches",
|
|
2419
|
+
"configDependencies",
|
|
2420
|
+
"ignoredBuiltDependencies",
|
|
2421
|
+
"ignoredOptionalDependencies",
|
|
2422
|
+
"neverBuiltDependencies",
|
|
2423
|
+
"onlyBuiltDependencies",
|
|
2424
|
+
"onlyBuiltDependenciesFile",
|
|
2425
|
+
"packageExtensions",
|
|
2426
|
+
"peerDependencyRules",
|
|
2427
|
+
"supportedArchitectures"
|
|
2428
|
+
],
|
|
2429
|
+
pathPattern: "^$"
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
order: { type: "asc" },
|
|
2433
|
+
pathPattern: ".*"
|
|
2434
|
+
}
|
|
2435
|
+
]
|
|
2436
|
+
}
|
|
2399
2437
|
}
|
|
2400
2438
|
];
|
|
2401
2439
|
}
|
|
@@ -2417,16 +2455,16 @@ var VuePackages = [
|
|
|
2417
2455
|
"@slidev/cli"
|
|
2418
2456
|
];
|
|
2419
2457
|
var defaultPluginRenaming = {
|
|
2458
|
+
"@eslint-react": "react",
|
|
2459
|
+
"@eslint-react/dom": "react-dom",
|
|
2460
|
+
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
2461
|
+
"@eslint-react/naming-convention": "react-naming-convention",
|
|
2420
2462
|
"@stylistic": "style",
|
|
2421
2463
|
"@typescript-eslint": "ts",
|
|
2422
2464
|
"import-x": "import",
|
|
2423
2465
|
"n": "node",
|
|
2424
2466
|
"vitest": "test",
|
|
2425
|
-
"yml": "yaml"
|
|
2426
|
-
"@eslint-react": "react",
|
|
2427
|
-
"@eslint-react/dom": "react-dom",
|
|
2428
|
-
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
2429
|
-
"@eslint-react/naming-convention": "react-naming-convention"
|
|
2467
|
+
"yml": "yaml"
|
|
2430
2468
|
};
|
|
2431
2469
|
function luxass(options = {}, ...userConfigs) {
|
|
2432
2470
|
const {
|
|
@@ -2437,12 +2475,12 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2437
2475
|
jsx: enableJsx = true,
|
|
2438
2476
|
react: enableReact = false,
|
|
2439
2477
|
regexp: enableRegexp = true,
|
|
2478
|
+
tailwindcss: enableTailwindCSS = false,
|
|
2479
|
+
type: projectType = "app",
|
|
2440
2480
|
typescript: enableTypeScript = (0, import_local_pkg3.isPackageExists)("typescript"),
|
|
2441
2481
|
unicorn: enableUnicorn = true,
|
|
2442
2482
|
unocss: enableUnoCSS = false,
|
|
2443
|
-
|
|
2444
|
-
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg3.isPackageExists)(i)),
|
|
2445
|
-
type: projectType = "app"
|
|
2483
|
+
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg3.isPackageExists)(i))
|
|
2446
2484
|
} = options;
|
|
2447
2485
|
let isInEditor = options.isInEditor;
|
|
2448
2486
|
if (isInEditor == null) {
|
|
@@ -2622,7 +2660,7 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2622
2660
|
}
|
|
2623
2661
|
|
|
2624
2662
|
// src/index.ts
|
|
2625
|
-
var
|
|
2663
|
+
var index_default = luxass;
|
|
2626
2664
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2627
2665
|
0 && (module.exports = {
|
|
2628
2666
|
GLOB_ASTRO,
|