@luxass/eslint-config 4.2.6 → 4.2.8
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 +4 -5
- package/dist/index.cjs +165 -446
- package/dist/index.d.cts +733 -12
- package/dist/index.d.ts +733 -12
- package/dist/{configs/index.cjs → index.js} +308 -516
- package/package.json +51 -85
- package/dist/chunk-2IR43M6N.mjs +0 -48
- package/dist/chunk-47ISSTHW.mjs +0 -291
- package/dist/chunk-4YBQZLPS.mjs +0 -68
- package/dist/chunk-4YT54JFZ.mjs +0 -48
- package/dist/chunk-5NK24IKQ.mjs +0 -26
- package/dist/chunk-AJS3TMZE.mjs +0 -63
- package/dist/chunk-C6FE5KXJ.mjs +0 -104
- package/dist/chunk-DAJA5AV3.mjs +0 -29
- package/dist/chunk-DCOLHWHC.mjs +0 -269
- package/dist/chunk-E4RVBKZB.mjs +0 -207
- package/dist/chunk-HZNHG5PB.mjs +0 -45
- package/dist/chunk-KOXCJL3C.mjs +0 -109
- package/dist/chunk-PFCAWBCD.mjs +0 -93
- package/dist/chunk-PFYV2TWZ.mjs +0 -117
- package/dist/chunk-QT6FHTFU.mjs +0 -92
- package/dist/chunk-RDZJT36Z.mjs +0 -57
- package/dist/chunk-RVSUTDCE.mjs +0 -57
- package/dist/chunk-TWAETZPX.mjs +0 -149
- package/dist/chunk-WSQOWO67.mjs +0 -16
- package/dist/chunk-XBASVDU6.mjs +0 -215
- package/dist/chunk-XD3UVRU7.mjs +0 -274
- package/dist/chunk-XGI647GZ.mjs +0 -81
- package/dist/chunk-XMXYE5WC.mjs +0 -183
- package/dist/chunk-YNMFVYL6.mjs +0 -69
- package/dist/chunk-YO3IYQ2L.mjs +0 -220
- package/dist/chunk-YZCJUX6Z.mjs +0 -0
- package/dist/configs/comments.cjs +0 -63
- package/dist/configs/comments.d.cts +0 -15
- package/dist/configs/comments.d.ts +0 -15
- package/dist/configs/comments.mjs +0 -6
- package/dist/configs/css/tailwindcss.cjs +0 -148
- package/dist/configs/css/tailwindcss.d.cts +0 -11
- package/dist/configs/css/tailwindcss.d.ts +0 -11
- package/dist/configs/css/tailwindcss.mjs +0 -8
- package/dist/configs/css/unocss.cjs +0 -133
- package/dist/configs/css/unocss.d.cts +0 -11
- package/dist/configs/css/unocss.d.ts +0 -11
- package/dist/configs/css/unocss.mjs +0 -8
- package/dist/configs/data/json.cjs +0 -155
- package/dist/configs/data/json.d.cts +0 -11
- package/dist/configs/data/json.d.ts +0 -11
- package/dist/configs/data/json.mjs +0 -8
- package/dist/configs/data/toml.cjs +0 -131
- package/dist/configs/data/toml.d.cts +0 -11
- package/dist/configs/data/toml.d.ts +0 -11
- package/dist/configs/data/toml.mjs +0 -8
- package/dist/configs/data/yaml.cjs +0 -143
- package/dist/configs/data/yaml.d.cts +0 -11
- package/dist/configs/data/yaml.d.ts +0 -11
- package/dist/configs/data/yaml.mjs +0 -8
- package/dist/configs/docs/jsdoc.cjs +0 -85
- package/dist/configs/docs/jsdoc.d.cts +0 -27
- package/dist/configs/docs/jsdoc.d.ts +0 -27
- package/dist/configs/docs/jsdoc.mjs +0 -7
- package/dist/configs/docs/markdown.cjs +0 -164
- package/dist/configs/docs/markdown.d.cts +0 -35
- package/dist/configs/docs/markdown.d.ts +0 -35
- package/dist/configs/docs/markdown.mjs +0 -8
- package/dist/configs/formatters.cjs +0 -274
- package/dist/configs/formatters.d.cts +0 -11
- package/dist/configs/formatters.d.ts +0 -11
- package/dist/configs/formatters.mjs +0 -9
- package/dist/configs/frameworks/astro.cjs +0 -179
- package/dist/configs/frameworks/astro.d.cts +0 -11
- package/dist/configs/frameworks/astro.d.ts +0 -11
- package/dist/configs/frameworks/astro.mjs +0 -8
- package/dist/configs/frameworks/nextjs.cjs +0 -180
- package/dist/configs/frameworks/nextjs.d.cts +0 -11
- package/dist/configs/frameworks/nextjs.d.ts +0 -11
- package/dist/configs/frameworks/nextjs.mjs +0 -8
- package/dist/configs/frameworks/react.cjs +0 -377
- package/dist/configs/frameworks/react.d.cts +0 -11
- package/dist/configs/frameworks/react.d.ts +0 -11
- package/dist/configs/frameworks/react.mjs +0 -8
- package/dist/configs/frameworks/solid.cjs +0 -360
- package/dist/configs/frameworks/solid.d.cts +0 -11
- package/dist/configs/frameworks/solid.d.ts +0 -11
- package/dist/configs/frameworks/solid.mjs +0 -8
- package/dist/configs/frameworks/vue.cjs +0 -293
- package/dist/configs/frameworks/vue.d.cts +0 -11
- package/dist/configs/frameworks/vue.d.ts +0 -11
- package/dist/configs/frameworks/vue.mjs +0 -8
- package/dist/configs/ignores.cjs +0 -96
- package/dist/configs/ignores.d.cts +0 -15
- package/dist/configs/ignores.d.ts +0 -15
- package/dist/configs/ignores.mjs +0 -7
- package/dist/configs/imports.cjs +0 -104
- package/dist/configs/imports.d.cts +0 -23
- package/dist/configs/imports.d.ts +0 -23
- package/dist/configs/imports.mjs +0 -7
- package/dist/configs/index.d.cts +0 -19
- package/dist/configs/index.d.ts +0 -19
- package/dist/configs/index.mjs +0 -99
- package/dist/configs/javascript.cjs +0 -324
- package/dist/configs/javascript.d.cts +0 -11
- package/dist/configs/javascript.d.ts +0 -11
- package/dist/configs/javascript.mjs +0 -7
- package/dist/configs/node.cjs +0 -60
- package/dist/configs/node.d.cts +0 -15
- package/dist/configs/node.d.ts +0 -15
- package/dist/configs/node.mjs +0 -6
- package/dist/configs/sort.cjs +0 -240
- package/dist/configs/sort.d.cts +0 -26
- package/dist/configs/sort.d.ts +0 -26
- package/dist/configs/sort.mjs +0 -8
- package/dist/configs/stylistic.cjs +0 -98
- package/dist/configs/stylistic.d.cts +0 -11
- package/dist/configs/stylistic.d.ts +0 -11
- package/dist/configs/stylistic.mjs +0 -9
- package/dist/configs/test.cjs +0 -210
- package/dist/configs/test.d.cts +0 -11
- package/dist/configs/test.d.ts +0 -11
- package/dist/configs/test.mjs +0 -8
- package/dist/configs/typescript.cjs +0 -291
- package/dist/configs/typescript.d.cts +0 -11
- package/dist/configs/typescript.d.ts +0 -11
- package/dist/configs/typescript.mjs +0 -8
- package/dist/configs/unicorn.cjs +0 -91
- package/dist/configs/unicorn.d.cts +0 -15
- package/dist/configs/unicorn.d.ts +0 -15
- package/dist/configs/unicorn.mjs +0 -6
- package/dist/globs.cjs +0 -158
- package/dist/globs.d.cts +0 -28
- package/dist/globs.d.ts +0 -28
- package/dist/globs.mjs +0 -56
- package/dist/index.mjs +0 -278
- package/dist/types-HqEzZfQU.d.cts +0 -668
- package/dist/types-HqEzZfQU.d.ts +0 -668
package/dist/index.cjs
CHANGED
|
@@ -30,8 +30,63 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
GLOB_ASTRO: () => GLOB_ASTRO,
|
|
34
|
+
GLOB_CSS: () => GLOB_CSS,
|
|
35
|
+
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
36
|
+
GLOB_HTML: () => GLOB_HTML,
|
|
37
|
+
GLOB_JS: () => GLOB_JS,
|
|
38
|
+
GLOB_JSON: () => GLOB_JSON,
|
|
39
|
+
GLOB_JSON5: () => GLOB_JSON5,
|
|
40
|
+
GLOB_JSONC: () => GLOB_JSONC,
|
|
41
|
+
GLOB_JSX: () => GLOB_JSX,
|
|
42
|
+
GLOB_LESS: () => GLOB_LESS,
|
|
43
|
+
GLOB_MARKDOWN: () => GLOB_MARKDOWN,
|
|
44
|
+
GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
|
|
45
|
+
GLOB_MARKDOWN_IN_MARKDOWN: () => GLOB_MARKDOWN_IN_MARKDOWN,
|
|
46
|
+
GLOB_NEXTJS_OG: () => GLOB_NEXTJS_OG,
|
|
47
|
+
GLOB_NEXTJS_ROUTES: () => GLOB_NEXTJS_ROUTES,
|
|
48
|
+
GLOB_POSTCSS: () => GLOB_POSTCSS,
|
|
49
|
+
GLOB_SCSS: () => GLOB_SCSS,
|
|
50
|
+
GLOB_SRC: () => GLOB_SRC,
|
|
51
|
+
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
52
|
+
GLOB_STYLE: () => GLOB_STYLE,
|
|
53
|
+
GLOB_TESTS: () => GLOB_TESTS,
|
|
54
|
+
GLOB_TOML: () => GLOB_TOML,
|
|
55
|
+
GLOB_TS: () => GLOB_TS,
|
|
56
|
+
GLOB_TSX: () => GLOB_TSX,
|
|
57
|
+
GLOB_VUE: () => GLOB_VUE,
|
|
58
|
+
GLOB_YAML: () => GLOB_YAML,
|
|
59
|
+
astro: () => astro,
|
|
60
|
+
combine: () => combine,
|
|
61
|
+
comments: () => comments,
|
|
62
|
+
ensure: () => ensure,
|
|
63
|
+
formatters: () => formatters,
|
|
64
|
+
getOverrides: () => getOverrides,
|
|
65
|
+
ignores: () => ignores,
|
|
66
|
+
imports: () => imports,
|
|
67
|
+
interop: () => interop,
|
|
68
|
+
javascript: () => javascript,
|
|
69
|
+
jsdoc: () => jsdoc,
|
|
70
|
+
jsonc: () => jsonc,
|
|
71
|
+
luxass: () => luxass,
|
|
72
|
+
markdown: () => markdown,
|
|
73
|
+
nextjs: () => nextjs,
|
|
74
|
+
node: () => node,
|
|
75
|
+
react: () => react,
|
|
76
|
+
renameRules: () => renameRules,
|
|
77
|
+
resolveSubOptions: () => resolveSubOptions,
|
|
78
|
+
sortPackageJson: () => sortPackageJson,
|
|
79
|
+
sortTsconfig: () => sortTsconfig,
|
|
80
|
+
stylistic: () => stylistic,
|
|
81
|
+
tailwindcss: () => tailwindcss,
|
|
82
|
+
test: () => test,
|
|
83
|
+
toArray: () => toArray,
|
|
84
|
+
toml: () => toml,
|
|
85
|
+
typescript: () => typescript,
|
|
86
|
+
unicorn: () => unicorn,
|
|
87
|
+
unocss: () => unocss,
|
|
88
|
+
vue: () => vue,
|
|
89
|
+
yaml: () => yaml
|
|
35
90
|
});
|
|
36
91
|
module.exports = __toCommonJS(src_exports);
|
|
37
92
|
|
|
@@ -123,9 +178,11 @@ function unicorn() {
|
|
|
123
178
|
// src/globs.ts
|
|
124
179
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
125
180
|
var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
181
|
+
var GLOB_JS = "**/*.?([cm])js";
|
|
126
182
|
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
127
183
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
128
184
|
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
185
|
+
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
129
186
|
var GLOB_CSS = "**/*.css";
|
|
130
187
|
var GLOB_POSTCSS = "**/*.{p,post}css";
|
|
131
188
|
var GLOB_LESS = "**/*.less";
|
|
@@ -138,6 +195,7 @@ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
|
138
195
|
var GLOB_VUE = "**/*.vue";
|
|
139
196
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
140
197
|
var GLOB_TOML = "**/*.toml";
|
|
198
|
+
var GLOB_HTML = "**/*.htm?(l)";
|
|
141
199
|
var GLOB_ASTRO = "**/*.astro";
|
|
142
200
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
143
201
|
var GLOB_TESTS = [
|
|
@@ -1271,24 +1329,18 @@ async function typescript(options = {}) {
|
|
|
1271
1329
|
var import_eslint_merge_processors2 = require("eslint-merge-processors");
|
|
1272
1330
|
async function vue(options = {}) {
|
|
1273
1331
|
const {
|
|
1274
|
-
a11y = false,
|
|
1275
1332
|
files = [GLOB_VUE],
|
|
1276
1333
|
overrides = {},
|
|
1277
1334
|
stylistic: stylistic2 = true
|
|
1278
1335
|
} = options;
|
|
1279
|
-
if (a11y) {
|
|
1280
|
-
await ensure(["eslint-plugin-vuejs-accessibility"]);
|
|
1281
|
-
}
|
|
1282
1336
|
const [
|
|
1283
1337
|
pluginVue,
|
|
1284
1338
|
parserVue,
|
|
1285
|
-
processorVueBlocks
|
|
1286
|
-
pluginA11y
|
|
1339
|
+
processorVueBlocks
|
|
1287
1340
|
] = await Promise.all([
|
|
1288
1341
|
interop(import("eslint-plugin-vue")),
|
|
1289
1342
|
interop(import("vue-eslint-parser")),
|
|
1290
|
-
interop(import("eslint-processor-vue-blocks"))
|
|
1291
|
-
...a11y ? [interop(import("eslint-plugin-vuejs-accessibility"))] : []
|
|
1343
|
+
interop(import("eslint-processor-vue-blocks"))
|
|
1292
1344
|
]);
|
|
1293
1345
|
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
1294
1346
|
const {
|
|
@@ -1297,9 +1349,28 @@ async function vue(options = {}) {
|
|
|
1297
1349
|
return [
|
|
1298
1350
|
{
|
|
1299
1351
|
name: "luxass:vue:setup",
|
|
1352
|
+
// This allows Vue plugin to work with auto imports
|
|
1353
|
+
// https://github.com/vuejs/eslint-plugin-vue/pull/2422
|
|
1354
|
+
languageOptions: {
|
|
1355
|
+
globals: {
|
|
1356
|
+
computed: "readonly",
|
|
1357
|
+
defineEmits: "readonly",
|
|
1358
|
+
defineExpose: "readonly",
|
|
1359
|
+
defineProps: "readonly",
|
|
1360
|
+
onMounted: "readonly",
|
|
1361
|
+
onUnmounted: "readonly",
|
|
1362
|
+
reactive: "readonly",
|
|
1363
|
+
ref: "readonly",
|
|
1364
|
+
shallowReactive: "readonly",
|
|
1365
|
+
shallowRef: "readonly",
|
|
1366
|
+
toRef: "readonly",
|
|
1367
|
+
toRefs: "readonly",
|
|
1368
|
+
watch: "readonly",
|
|
1369
|
+
watchEffect: "readonly"
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1300
1372
|
plugins: {
|
|
1301
|
-
vue: pluginVue
|
|
1302
|
-
...a11y ? { "vue-a11y": pluginA11y } : {}
|
|
1373
|
+
vue: pluginVue
|
|
1303
1374
|
}
|
|
1304
1375
|
},
|
|
1305
1376
|
{
|
|
@@ -1435,28 +1506,6 @@ async function vue(options = {}) {
|
|
|
1435
1506
|
"vue/space-in-parens": ["error", "never"],
|
|
1436
1507
|
"vue/template-curly-spacing": "error"
|
|
1437
1508
|
} : {},
|
|
1438
|
-
...a11y ? {
|
|
1439
|
-
"vue-a11y/alt-text": "error",
|
|
1440
|
-
"vue-a11y/anchor-has-content": "error",
|
|
1441
|
-
"vue-a11y/aria-props": "error",
|
|
1442
|
-
"vue-a11y/aria-role": "error",
|
|
1443
|
-
"vue-a11y/aria-unsupported-elements": "error",
|
|
1444
|
-
"vue-a11y/click-events-have-key-events": "error",
|
|
1445
|
-
"vue-a11y/form-control-has-label": "error",
|
|
1446
|
-
"vue-a11y/heading-has-content": "error",
|
|
1447
|
-
"vue-a11y/iframe-has-title": "error",
|
|
1448
|
-
"vue-a11y/interactive-supports-focus": "error",
|
|
1449
|
-
"vue-a11y/label-has-for": "error",
|
|
1450
|
-
"vue-a11y/media-has-caption": "error",
|
|
1451
|
-
"vue-a11y/mouse-events-have-key-events": "error",
|
|
1452
|
-
"vue-a11y/no-access-key": "error",
|
|
1453
|
-
"vue-a11y/no-autofocus": "error",
|
|
1454
|
-
"vue-a11y/no-distracting-elements": "error",
|
|
1455
|
-
"vue-a11y/no-redundant-roles": "error",
|
|
1456
|
-
"vue-a11y/no-static-element-interactions": "error",
|
|
1457
|
-
"vue-a11y/role-has-required-aria-props": "error",
|
|
1458
|
-
"vue-a11y/tabindex-no-positive": "error"
|
|
1459
|
-
} : {},
|
|
1460
1509
|
...overrides
|
|
1461
1510
|
}
|
|
1462
1511
|
}
|
|
@@ -1534,102 +1583,6 @@ async function yaml(options = {}) {
|
|
|
1534
1583
|
];
|
|
1535
1584
|
}
|
|
1536
1585
|
|
|
1537
|
-
// src/custom-rules/utils.ts
|
|
1538
|
-
var import_utils8 = require("@typescript-eslint/utils");
|
|
1539
|
-
var createRule = import_utils8.ESLintUtils.RuleCreator((ruleName) => `https://github.com/luxass/eslint-config/blob/main/src/custom-rules/${ruleName}/README.md`);
|
|
1540
|
-
|
|
1541
|
-
// src/custom-rules/no-only-tests/index.ts
|
|
1542
|
-
var RULE_NAME = "no-only-tests";
|
|
1543
|
-
var DEFAULT_OPTIONS = {
|
|
1544
|
-
blocks: ["describe", "it", "test"],
|
|
1545
|
-
focus: ["only"]
|
|
1546
|
-
};
|
|
1547
|
-
function getPath(node2, path = []) {
|
|
1548
|
-
if (node2) {
|
|
1549
|
-
const nodeName = node2.name || node2.property && node2.property.name;
|
|
1550
|
-
if (node2.object) {
|
|
1551
|
-
return getPath(
|
|
1552
|
-
node2.object,
|
|
1553
|
-
[nodeName, ...path]
|
|
1554
|
-
);
|
|
1555
|
-
}
|
|
1556
|
-
if (node2.callee)
|
|
1557
|
-
return getPath(node2.callee, path);
|
|
1558
|
-
return [nodeName, ...path];
|
|
1559
|
-
}
|
|
1560
|
-
return path;
|
|
1561
|
-
}
|
|
1562
|
-
var noOnlyTests = createRule({
|
|
1563
|
-
name: RULE_NAME,
|
|
1564
|
-
create: (context, [options]) => {
|
|
1565
|
-
const {
|
|
1566
|
-
blocks = DEFAULT_OPTIONS.blocks,
|
|
1567
|
-
focus = DEFAULT_OPTIONS.focus
|
|
1568
|
-
} = options;
|
|
1569
|
-
return {
|
|
1570
|
-
Identifier(node2) {
|
|
1571
|
-
const parent = node2.parent?.object;
|
|
1572
|
-
if (!parent)
|
|
1573
|
-
return;
|
|
1574
|
-
if (!focus.includes(node2.name))
|
|
1575
|
-
return;
|
|
1576
|
-
const callPath = getPath(node2.parent).join(".");
|
|
1577
|
-
const found = blocks.find((block) => {
|
|
1578
|
-
if (block.endsWith("*")) {
|
|
1579
|
-
return callPath.startsWith(block.replace(/\*$/, ""));
|
|
1580
|
-
}
|
|
1581
|
-
return callPath.startsWith(`${block}.`);
|
|
1582
|
-
});
|
|
1583
|
-
if (found) {
|
|
1584
|
-
context.report({
|
|
1585
|
-
data: { block: callPath.split(".")[0], focus: node2.name },
|
|
1586
|
-
messageId: "not-permitted",
|
|
1587
|
-
node: node2
|
|
1588
|
-
});
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
};
|
|
1592
|
-
},
|
|
1593
|
-
defaultOptions: [
|
|
1594
|
-
{
|
|
1595
|
-
blocks: ["describe", "it", "test"],
|
|
1596
|
-
focus: ["only"]
|
|
1597
|
-
}
|
|
1598
|
-
],
|
|
1599
|
-
meta: {
|
|
1600
|
-
docs: {
|
|
1601
|
-
description: "disallow .only blocks in tests",
|
|
1602
|
-
recommended: "recommended"
|
|
1603
|
-
},
|
|
1604
|
-
messages: {
|
|
1605
|
-
"not-permitted": "{{ block }}.{{ focus }} not permitted"
|
|
1606
|
-
},
|
|
1607
|
-
schema: [
|
|
1608
|
-
{
|
|
1609
|
-
additionalProperties: false,
|
|
1610
|
-
properties: {
|
|
1611
|
-
blocks: {
|
|
1612
|
-
items: {
|
|
1613
|
-
type: "string"
|
|
1614
|
-
},
|
|
1615
|
-
type: "array",
|
|
1616
|
-
uniqueItems: true
|
|
1617
|
-
},
|
|
1618
|
-
focus: {
|
|
1619
|
-
items: {
|
|
1620
|
-
type: "string"
|
|
1621
|
-
},
|
|
1622
|
-
type: "array",
|
|
1623
|
-
uniqueItems: true
|
|
1624
|
-
}
|
|
1625
|
-
},
|
|
1626
|
-
type: "object"
|
|
1627
|
-
}
|
|
1628
|
-
],
|
|
1629
|
-
type: "layout"
|
|
1630
|
-
}
|
|
1631
|
-
});
|
|
1632
|
-
|
|
1633
1586
|
// src/configs/test.ts
|
|
1634
1587
|
async function test(options = {}) {
|
|
1635
1588
|
const {
|
|
@@ -1649,8 +1602,7 @@ async function test(options = {}) {
|
|
|
1649
1602
|
test: {
|
|
1650
1603
|
...pluginVitest,
|
|
1651
1604
|
rules: {
|
|
1652
|
-
...pluginVitest.rules
|
|
1653
|
-
"no-only-tests": noOnlyTests
|
|
1605
|
+
...pluginVitest.rules
|
|
1654
1606
|
}
|
|
1655
1607
|
}
|
|
1656
1608
|
}
|
|
@@ -1664,7 +1616,7 @@ async function test(options = {}) {
|
|
|
1664
1616
|
{ fn: "it", withinDescribe: "it" }
|
|
1665
1617
|
],
|
|
1666
1618
|
"test/no-identical-title": "error",
|
|
1667
|
-
"test/no-
|
|
1619
|
+
"test/no-focused-tests": editor ? "off" : "error",
|
|
1668
1620
|
"test/prefer-hooks-in-order": "error",
|
|
1669
1621
|
"test/prefer-lowercase-title": "error",
|
|
1670
1622
|
...overrides
|
|
@@ -2074,15 +2026,18 @@ async function astro(options) {
|
|
|
2074
2026
|
a11y = false,
|
|
2075
2027
|
files = [GLOB_ASTRO],
|
|
2076
2028
|
overrides = {},
|
|
2077
|
-
typescript: typescript2 = true
|
|
2029
|
+
typescript: typescript2 = true,
|
|
2030
|
+
stylistic: stylistic2 = true
|
|
2078
2031
|
} = options;
|
|
2079
2032
|
const [
|
|
2080
2033
|
pluginAstro,
|
|
2081
2034
|
parserAstro,
|
|
2035
|
+
parserTs,
|
|
2082
2036
|
pluginA11y
|
|
2083
2037
|
] = await Promise.all([
|
|
2084
2038
|
interop(import("eslint-plugin-astro")),
|
|
2085
2039
|
interop(import("astro-eslint-parser")),
|
|
2040
|
+
interop(import("@typescript-eslint/parser")),
|
|
2086
2041
|
...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
2087
2042
|
]);
|
|
2088
2043
|
return [
|
|
@@ -2097,15 +2052,10 @@ async function astro(options) {
|
|
|
2097
2052
|
name: "luxass:astro:rules",
|
|
2098
2053
|
files,
|
|
2099
2054
|
languageOptions: {
|
|
2100
|
-
globals: {
|
|
2101
|
-
"astro/astro": true,
|
|
2102
|
-
"es2020": true,
|
|
2103
|
-
"node": true
|
|
2104
|
-
},
|
|
2105
2055
|
parser: parserAstro,
|
|
2106
2056
|
parserOptions: {
|
|
2107
2057
|
extraFileExtensions: [".astro"],
|
|
2108
|
-
parser: typescript2 ?
|
|
2058
|
+
parser: typescript2 ? parserTs : null,
|
|
2109
2059
|
sourceType: "module"
|
|
2110
2060
|
}
|
|
2111
2061
|
},
|
|
@@ -2113,28 +2063,16 @@ async function astro(options) {
|
|
|
2113
2063
|
// Disallow conflicting set directives and child contents
|
|
2114
2064
|
// https://ota-meshi.github.io/eslint-plugin-astro/rules/no-conflict-set-directives/
|
|
2115
2065
|
"astro/no-conflict-set-directives": "error",
|
|
2116
|
-
// Disallow
|
|
2117
|
-
// https://ota-meshi.github.io/eslint-plugin-astro/rules/no-
|
|
2118
|
-
"astro/no-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
// https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-getentrybyslug/
|
|
2127
|
-
"astro/no-deprecated-getentrybyslug": "error",
|
|
2128
|
-
// Disallow unused define:vars={...} in style tag
|
|
2129
|
-
// https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unused-define-vars-in-style/
|
|
2130
|
-
"astro/no-unused-define-vars-in-style": "error",
|
|
2131
|
-
// Disallow warnings when compiling
|
|
2132
|
-
// https://ota-meshi.github.io/eslint-plugin-astro/rules/valid-compile/
|
|
2133
|
-
"astro/valid-compile": "error",
|
|
2134
|
-
"style/jsx-closing-tag-location": "off",
|
|
2135
|
-
"style/jsx-indent": "off",
|
|
2136
|
-
"style/jsx-one-expression-per-line": "off",
|
|
2137
|
-
"style/multiline-ternary": ["error", "never"],
|
|
2066
|
+
// Disallow use of `set:html` directive
|
|
2067
|
+
// https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-html-directive/
|
|
2068
|
+
"astro/no-set-html-directive": "off",
|
|
2069
|
+
...stylistic2 ? {
|
|
2070
|
+
"style/indent": "off",
|
|
2071
|
+
"style/jsx-indent": "off",
|
|
2072
|
+
"style/jsx-closing-tag-location": "off",
|
|
2073
|
+
"style/jsx-one-expression-per-line": "off",
|
|
2074
|
+
"style/no-multiple-empty-lines": "off"
|
|
2075
|
+
} : {},
|
|
2138
2076
|
...overrides
|
|
2139
2077
|
}
|
|
2140
2078
|
},
|
|
@@ -2165,7 +2103,7 @@ async function astro(options) {
|
|
|
2165
2103
|
browser: true,
|
|
2166
2104
|
es2020: true
|
|
2167
2105
|
},
|
|
2168
|
-
parser: typescript2 ?
|
|
2106
|
+
parser: typescript2 ? parserTs : null,
|
|
2169
2107
|
parserOptions: {
|
|
2170
2108
|
project: null,
|
|
2171
2109
|
sourceType: "module"
|
|
@@ -2451,268 +2389,6 @@ async function toml(options = {}) {
|
|
|
2451
2389
|
];
|
|
2452
2390
|
}
|
|
2453
2391
|
|
|
2454
|
-
// src/configs/frameworks/solid.ts
|
|
2455
|
-
async function solid(options = {}) {
|
|
2456
|
-
const {
|
|
2457
|
-
a11y = false,
|
|
2458
|
-
files = [GLOB_JSX, GLOB_TSX],
|
|
2459
|
-
overrides = {},
|
|
2460
|
-
typescript: typescript2 = true
|
|
2461
|
-
} = options;
|
|
2462
|
-
await ensure([
|
|
2463
|
-
"eslint-plugin-solid"
|
|
2464
|
-
]);
|
|
2465
|
-
const [
|
|
2466
|
-
pluginSolid
|
|
2467
|
-
] = await Promise.all([
|
|
2468
|
-
interop(import("eslint-plugin-solid"))
|
|
2469
|
-
]);
|
|
2470
|
-
return [
|
|
2471
|
-
{
|
|
2472
|
-
name: "luxass:solid:setup",
|
|
2473
|
-
plugins: {
|
|
2474
|
-
solid: pluginSolid
|
|
2475
|
-
}
|
|
2476
|
-
},
|
|
2477
|
-
{
|
|
2478
|
-
name: "luxass:solid:rules",
|
|
2479
|
-
files,
|
|
2480
|
-
languageOptions: {
|
|
2481
|
-
parserOptions: {
|
|
2482
|
-
ecmaFeatures: {
|
|
2483
|
-
jsx: true
|
|
2484
|
-
}
|
|
2485
|
-
},
|
|
2486
|
-
sourceType: "module"
|
|
2487
|
-
},
|
|
2488
|
-
rules: {
|
|
2489
|
-
...a11y ? {
|
|
2490
|
-
// recommended rules for jsx-a11y
|
|
2491
|
-
"jsx-a11y/alt-text": "error",
|
|
2492
|
-
"jsx-a11y/anchor-ambiguous-text": "off",
|
|
2493
|
-
"jsx-a11y/anchor-has-content": "error",
|
|
2494
|
-
"jsx-a11y/anchor-is-valid": "error",
|
|
2495
|
-
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
2496
|
-
"jsx-a11y/aria-props": "error",
|
|
2497
|
-
"jsx-a11y/aria-proptypes": "error",
|
|
2498
|
-
"jsx-a11y/aria-role": "error",
|
|
2499
|
-
"jsx-a11y/aria-unsupported-elements": "error",
|
|
2500
|
-
"jsx-a11y/autocomplete-valid": "error",
|
|
2501
|
-
"jsx-a11y/click-events-have-key-events": "error",
|
|
2502
|
-
"jsx-a11y/control-has-associated-label": [
|
|
2503
|
-
"off",
|
|
2504
|
-
{
|
|
2505
|
-
ignoreElements: [
|
|
2506
|
-
"audio",
|
|
2507
|
-
"canvas",
|
|
2508
|
-
"embed",
|
|
2509
|
-
"input",
|
|
2510
|
-
"textarea",
|
|
2511
|
-
"tr",
|
|
2512
|
-
"video"
|
|
2513
|
-
],
|
|
2514
|
-
ignoreRoles: [
|
|
2515
|
-
"grid",
|
|
2516
|
-
"listbox",
|
|
2517
|
-
"menu",
|
|
2518
|
-
"menubar",
|
|
2519
|
-
"radiogroup",
|
|
2520
|
-
"row",
|
|
2521
|
-
"tablist",
|
|
2522
|
-
"toolbar",
|
|
2523
|
-
"tree",
|
|
2524
|
-
"treegrid"
|
|
2525
|
-
],
|
|
2526
|
-
includeRoles: [
|
|
2527
|
-
"alert",
|
|
2528
|
-
"dialog"
|
|
2529
|
-
]
|
|
2530
|
-
}
|
|
2531
|
-
],
|
|
2532
|
-
"jsx-a11y/heading-has-content": "error",
|
|
2533
|
-
"jsx-a11y/html-has-lang": "error",
|
|
2534
|
-
"jsx-a11y/iframe-has-title": "error",
|
|
2535
|
-
"jsx-a11y/img-redundant-alt": "error",
|
|
2536
|
-
"jsx-a11y/interactive-supports-focus": [
|
|
2537
|
-
"error",
|
|
2538
|
-
{
|
|
2539
|
-
tabbable: [
|
|
2540
|
-
"button",
|
|
2541
|
-
"checkbox",
|
|
2542
|
-
"link",
|
|
2543
|
-
"searchbox",
|
|
2544
|
-
"spinbutton",
|
|
2545
|
-
"switch",
|
|
2546
|
-
"textbox"
|
|
2547
|
-
]
|
|
2548
|
-
}
|
|
2549
|
-
],
|
|
2550
|
-
"jsx-a11y/label-has-associated-control": "error",
|
|
2551
|
-
"jsx-a11y/label-has-for": "off",
|
|
2552
|
-
"jsx-a11y/media-has-caption": "error",
|
|
2553
|
-
"jsx-a11y/mouse-events-have-key-events": "error",
|
|
2554
|
-
"jsx-a11y/no-access-key": "error",
|
|
2555
|
-
"jsx-a11y/no-autofocus": "error",
|
|
2556
|
-
"jsx-a11y/no-distracting-elements": "error",
|
|
2557
|
-
"jsx-a11y/no-interactive-element-to-noninteractive-role": [
|
|
2558
|
-
"error",
|
|
2559
|
-
{
|
|
2560
|
-
canvas: [
|
|
2561
|
-
"img"
|
|
2562
|
-
],
|
|
2563
|
-
tr: [
|
|
2564
|
-
"none",
|
|
2565
|
-
"presentation"
|
|
2566
|
-
]
|
|
2567
|
-
}
|
|
2568
|
-
],
|
|
2569
|
-
"jsx-a11y/no-noninteractive-element-interactions": [
|
|
2570
|
-
"error",
|
|
2571
|
-
{
|
|
2572
|
-
alert: [
|
|
2573
|
-
"onKeyUp",
|
|
2574
|
-
"onKeyDown",
|
|
2575
|
-
"onKeyPress"
|
|
2576
|
-
],
|
|
2577
|
-
body: [
|
|
2578
|
-
"onError",
|
|
2579
|
-
"onLoad"
|
|
2580
|
-
],
|
|
2581
|
-
dialog: [
|
|
2582
|
-
"onKeyUp",
|
|
2583
|
-
"onKeyDown",
|
|
2584
|
-
"onKeyPress"
|
|
2585
|
-
],
|
|
2586
|
-
handlers: [
|
|
2587
|
-
"onClick",
|
|
2588
|
-
"onError",
|
|
2589
|
-
"onLoad",
|
|
2590
|
-
"onMouseDown",
|
|
2591
|
-
"onMouseUp",
|
|
2592
|
-
"onKeyPress",
|
|
2593
|
-
"onKeyDown",
|
|
2594
|
-
"onKeyUp"
|
|
2595
|
-
],
|
|
2596
|
-
iframe: [
|
|
2597
|
-
"onError",
|
|
2598
|
-
"onLoad"
|
|
2599
|
-
],
|
|
2600
|
-
img: [
|
|
2601
|
-
"onError",
|
|
2602
|
-
"onLoad"
|
|
2603
|
-
]
|
|
2604
|
-
}
|
|
2605
|
-
],
|
|
2606
|
-
"jsx-a11y/no-noninteractive-element-to-interactive-role": [
|
|
2607
|
-
"error",
|
|
2608
|
-
{
|
|
2609
|
-
fieldset: [
|
|
2610
|
-
"radiogroup",
|
|
2611
|
-
"presentation"
|
|
2612
|
-
],
|
|
2613
|
-
li: [
|
|
2614
|
-
"menuitem",
|
|
2615
|
-
"option",
|
|
2616
|
-
"row",
|
|
2617
|
-
"tab",
|
|
2618
|
-
"treeitem"
|
|
2619
|
-
],
|
|
2620
|
-
ol: [
|
|
2621
|
-
"listbox",
|
|
2622
|
-
"menu",
|
|
2623
|
-
"menubar",
|
|
2624
|
-
"radiogroup",
|
|
2625
|
-
"tablist",
|
|
2626
|
-
"tree",
|
|
2627
|
-
"treegrid"
|
|
2628
|
-
],
|
|
2629
|
-
table: [
|
|
2630
|
-
"grid"
|
|
2631
|
-
],
|
|
2632
|
-
td: [
|
|
2633
|
-
"gridcell"
|
|
2634
|
-
],
|
|
2635
|
-
ul: [
|
|
2636
|
-
"listbox",
|
|
2637
|
-
"menu",
|
|
2638
|
-
"menubar",
|
|
2639
|
-
"radiogroup",
|
|
2640
|
-
"tablist",
|
|
2641
|
-
"tree",
|
|
2642
|
-
"treegrid"
|
|
2643
|
-
]
|
|
2644
|
-
}
|
|
2645
|
-
],
|
|
2646
|
-
"jsx-a11y/no-noninteractive-tabindex": [
|
|
2647
|
-
"error",
|
|
2648
|
-
{
|
|
2649
|
-
allowExpressionValues: true,
|
|
2650
|
-
roles: [
|
|
2651
|
-
"tabpanel"
|
|
2652
|
-
],
|
|
2653
|
-
tags: []
|
|
2654
|
-
}
|
|
2655
|
-
],
|
|
2656
|
-
"jsx-a11y/no-redundant-roles": "error",
|
|
2657
|
-
"jsx-a11y/no-static-element-interactions": [
|
|
2658
|
-
"error",
|
|
2659
|
-
{
|
|
2660
|
-
allowExpressionValues: true,
|
|
2661
|
-
handlers: [
|
|
2662
|
-
"onClick",
|
|
2663
|
-
"onMouseDown",
|
|
2664
|
-
"onMouseUp",
|
|
2665
|
-
"onKeyPress",
|
|
2666
|
-
"onKeyDown",
|
|
2667
|
-
"onKeyUp"
|
|
2668
|
-
]
|
|
2669
|
-
}
|
|
2670
|
-
],
|
|
2671
|
-
"jsx-a11y/role-has-required-aria-props": "error",
|
|
2672
|
-
"jsx-a11y/role-supports-aria-props": "error",
|
|
2673
|
-
"jsx-a11y/scope": "error",
|
|
2674
|
-
"jsx-a11y/tabindex-no-positive": "error"
|
|
2675
|
-
} : {},
|
|
2676
|
-
// solid recommended rules
|
|
2677
|
-
// reactivity
|
|
2678
|
-
"solid/components-return-once": 1,
|
|
2679
|
-
"solid/event-handlers": 1,
|
|
2680
|
-
// these rules are mostly style suggestions
|
|
2681
|
-
"solid/imports": 1,
|
|
2682
|
-
// identifier usage is important
|
|
2683
|
-
"solid/jsx-no-duplicate-props": 2,
|
|
2684
|
-
"solid/jsx-no-script-url": 2,
|
|
2685
|
-
"solid/jsx-no-undef": 2,
|
|
2686
|
-
"solid/jsx-uses-vars": 2,
|
|
2687
|
-
"solid/no-array-handlers": 0,
|
|
2688
|
-
"solid/no-destructure": 2,
|
|
2689
|
-
// security problems
|
|
2690
|
-
"solid/no-innerhtml": 2,
|
|
2691
|
-
// only necessary for resource-constrained environments
|
|
2692
|
-
"solid/no-proxy-apis": 0,
|
|
2693
|
-
"solid/no-react-deps": 1,
|
|
2694
|
-
"solid/no-react-specific-props": 1,
|
|
2695
|
-
"solid/no-unknown-namespaces": 2,
|
|
2696
|
-
// deprecated
|
|
2697
|
-
"solid/prefer-classlist": 0,
|
|
2698
|
-
"solid/prefer-for": 2,
|
|
2699
|
-
// handled by Solid compiler, opt-in style suggestion
|
|
2700
|
-
"solid/prefer-show": 0,
|
|
2701
|
-
"solid/reactivity": 1,
|
|
2702
|
-
"solid/self-closing-comp": 1,
|
|
2703
|
-
"solid/style-prop": 1,
|
|
2704
|
-
...typescript2 ? {
|
|
2705
|
-
"solid/jsx-no-undef": [2, { typescriptEnabled: true }],
|
|
2706
|
-
// namespaces taken care of by TS
|
|
2707
|
-
"solid/no-unknown-namespaces": 0
|
|
2708
|
-
} : {},
|
|
2709
|
-
// overrides
|
|
2710
|
-
...overrides
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
];
|
|
2714
|
-
}
|
|
2715
|
-
|
|
2716
2392
|
// src/factory.ts
|
|
2717
2393
|
var FLAT_CONFIG_PROPS = [
|
|
2718
2394
|
"name",
|
|
@@ -2725,6 +2401,12 @@ var FLAT_CONFIG_PROPS = [
|
|
|
2725
2401
|
"rules",
|
|
2726
2402
|
"settings"
|
|
2727
2403
|
];
|
|
2404
|
+
var VuePackages = [
|
|
2405
|
+
"vue",
|
|
2406
|
+
"nuxt",
|
|
2407
|
+
"vitepress",
|
|
2408
|
+
"@slidev/cli"
|
|
2409
|
+
];
|
|
2728
2410
|
async function luxass(options = {}, ...userConfigs) {
|
|
2729
2411
|
const {
|
|
2730
2412
|
astro: enableAstro = false,
|
|
@@ -2733,11 +2415,10 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2733
2415
|
gitignore: enableGitignore = true,
|
|
2734
2416
|
nextjs: enableNextJS = false,
|
|
2735
2417
|
react: enableReact = false,
|
|
2736
|
-
solid: enableSolid = false,
|
|
2737
2418
|
tailwindcss: enableTailwindCSS = false,
|
|
2738
2419
|
typescript: enableTypeScript = (0, import_local_pkg3.isPackageExists)("typescript"),
|
|
2739
2420
|
unocss: enableUnoCSS = false,
|
|
2740
|
-
vue: enableVue =
|
|
2421
|
+
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg3.isPackageExists)(i))
|
|
2741
2422
|
} = options;
|
|
2742
2423
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
2743
2424
|
if (stylisticOptions && !("jsx" in stylisticOptions)) {
|
|
@@ -2805,21 +2486,6 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2805
2486
|
})
|
|
2806
2487
|
);
|
|
2807
2488
|
}
|
|
2808
|
-
if (enableSolid) {
|
|
2809
|
-
configs.push(
|
|
2810
|
-
// TODO: Analyze if this way is better for performance
|
|
2811
|
-
// await interop(import("./configs/solid")).then((plugin) => plugin.solid({
|
|
2812
|
-
// ...resolveSubOptions(options, "solid"),
|
|
2813
|
-
// overrides: getOverrides(options, "solid"),
|
|
2814
|
-
// typescript: !!enableTypeScript,
|
|
2815
|
-
// })),
|
|
2816
|
-
solid({
|
|
2817
|
-
...resolveSubOptions(options, "solid"),
|
|
2818
|
-
overrides: getOverrides(options, "solid"),
|
|
2819
|
-
typescript: !!enableTypeScript
|
|
2820
|
-
})
|
|
2821
|
-
);
|
|
2822
|
-
}
|
|
2823
2489
|
if (enableVue) {
|
|
2824
2490
|
configs.push(
|
|
2825
2491
|
vue({
|
|
@@ -2902,10 +2568,63 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2902
2568
|
);
|
|
2903
2569
|
return merged;
|
|
2904
2570
|
}
|
|
2905
|
-
|
|
2906
|
-
// src/index.ts
|
|
2907
|
-
var src_default = luxass;
|
|
2908
2571
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2909
2572
|
0 && (module.exports = {
|
|
2910
|
-
|
|
2573
|
+
GLOB_ASTRO,
|
|
2574
|
+
GLOB_CSS,
|
|
2575
|
+
GLOB_EXCLUDE,
|
|
2576
|
+
GLOB_HTML,
|
|
2577
|
+
GLOB_JS,
|
|
2578
|
+
GLOB_JSON,
|
|
2579
|
+
GLOB_JSON5,
|
|
2580
|
+
GLOB_JSONC,
|
|
2581
|
+
GLOB_JSX,
|
|
2582
|
+
GLOB_LESS,
|
|
2583
|
+
GLOB_MARKDOWN,
|
|
2584
|
+
GLOB_MARKDOWN_CODE,
|
|
2585
|
+
GLOB_MARKDOWN_IN_MARKDOWN,
|
|
2586
|
+
GLOB_NEXTJS_OG,
|
|
2587
|
+
GLOB_NEXTJS_ROUTES,
|
|
2588
|
+
GLOB_POSTCSS,
|
|
2589
|
+
GLOB_SCSS,
|
|
2590
|
+
GLOB_SRC,
|
|
2591
|
+
GLOB_SRC_EXT,
|
|
2592
|
+
GLOB_STYLE,
|
|
2593
|
+
GLOB_TESTS,
|
|
2594
|
+
GLOB_TOML,
|
|
2595
|
+
GLOB_TS,
|
|
2596
|
+
GLOB_TSX,
|
|
2597
|
+
GLOB_VUE,
|
|
2598
|
+
GLOB_YAML,
|
|
2599
|
+
astro,
|
|
2600
|
+
combine,
|
|
2601
|
+
comments,
|
|
2602
|
+
ensure,
|
|
2603
|
+
formatters,
|
|
2604
|
+
getOverrides,
|
|
2605
|
+
ignores,
|
|
2606
|
+
imports,
|
|
2607
|
+
interop,
|
|
2608
|
+
javascript,
|
|
2609
|
+
jsdoc,
|
|
2610
|
+
jsonc,
|
|
2611
|
+
luxass,
|
|
2612
|
+
markdown,
|
|
2613
|
+
nextjs,
|
|
2614
|
+
node,
|
|
2615
|
+
react,
|
|
2616
|
+
renameRules,
|
|
2617
|
+
resolveSubOptions,
|
|
2618
|
+
sortPackageJson,
|
|
2619
|
+
sortTsconfig,
|
|
2620
|
+
stylistic,
|
|
2621
|
+
tailwindcss,
|
|
2622
|
+
test,
|
|
2623
|
+
toArray,
|
|
2624
|
+
toml,
|
|
2625
|
+
typescript,
|
|
2626
|
+
unicorn,
|
|
2627
|
+
unocss,
|
|
2628
|
+
vue,
|
|
2629
|
+
yaml
|
|
2911
2630
|
});
|