@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.
Files changed (134) hide show
  1. package/README.md +4 -5
  2. package/dist/index.cjs +165 -446
  3. package/dist/index.d.cts +733 -12
  4. package/dist/index.d.ts +733 -12
  5. package/dist/{configs/index.cjs → index.js} +308 -516
  6. package/package.json +51 -85
  7. package/dist/chunk-2IR43M6N.mjs +0 -48
  8. package/dist/chunk-47ISSTHW.mjs +0 -291
  9. package/dist/chunk-4YBQZLPS.mjs +0 -68
  10. package/dist/chunk-4YT54JFZ.mjs +0 -48
  11. package/dist/chunk-5NK24IKQ.mjs +0 -26
  12. package/dist/chunk-AJS3TMZE.mjs +0 -63
  13. package/dist/chunk-C6FE5KXJ.mjs +0 -104
  14. package/dist/chunk-DAJA5AV3.mjs +0 -29
  15. package/dist/chunk-DCOLHWHC.mjs +0 -269
  16. package/dist/chunk-E4RVBKZB.mjs +0 -207
  17. package/dist/chunk-HZNHG5PB.mjs +0 -45
  18. package/dist/chunk-KOXCJL3C.mjs +0 -109
  19. package/dist/chunk-PFCAWBCD.mjs +0 -93
  20. package/dist/chunk-PFYV2TWZ.mjs +0 -117
  21. package/dist/chunk-QT6FHTFU.mjs +0 -92
  22. package/dist/chunk-RDZJT36Z.mjs +0 -57
  23. package/dist/chunk-RVSUTDCE.mjs +0 -57
  24. package/dist/chunk-TWAETZPX.mjs +0 -149
  25. package/dist/chunk-WSQOWO67.mjs +0 -16
  26. package/dist/chunk-XBASVDU6.mjs +0 -215
  27. package/dist/chunk-XD3UVRU7.mjs +0 -274
  28. package/dist/chunk-XGI647GZ.mjs +0 -81
  29. package/dist/chunk-XMXYE5WC.mjs +0 -183
  30. package/dist/chunk-YNMFVYL6.mjs +0 -69
  31. package/dist/chunk-YO3IYQ2L.mjs +0 -220
  32. package/dist/chunk-YZCJUX6Z.mjs +0 -0
  33. package/dist/configs/comments.cjs +0 -63
  34. package/dist/configs/comments.d.cts +0 -15
  35. package/dist/configs/comments.d.ts +0 -15
  36. package/dist/configs/comments.mjs +0 -6
  37. package/dist/configs/css/tailwindcss.cjs +0 -148
  38. package/dist/configs/css/tailwindcss.d.cts +0 -11
  39. package/dist/configs/css/tailwindcss.d.ts +0 -11
  40. package/dist/configs/css/tailwindcss.mjs +0 -8
  41. package/dist/configs/css/unocss.cjs +0 -133
  42. package/dist/configs/css/unocss.d.cts +0 -11
  43. package/dist/configs/css/unocss.d.ts +0 -11
  44. package/dist/configs/css/unocss.mjs +0 -8
  45. package/dist/configs/data/json.cjs +0 -155
  46. package/dist/configs/data/json.d.cts +0 -11
  47. package/dist/configs/data/json.d.ts +0 -11
  48. package/dist/configs/data/json.mjs +0 -8
  49. package/dist/configs/data/toml.cjs +0 -131
  50. package/dist/configs/data/toml.d.cts +0 -11
  51. package/dist/configs/data/toml.d.ts +0 -11
  52. package/dist/configs/data/toml.mjs +0 -8
  53. package/dist/configs/data/yaml.cjs +0 -143
  54. package/dist/configs/data/yaml.d.cts +0 -11
  55. package/dist/configs/data/yaml.d.ts +0 -11
  56. package/dist/configs/data/yaml.mjs +0 -8
  57. package/dist/configs/docs/jsdoc.cjs +0 -85
  58. package/dist/configs/docs/jsdoc.d.cts +0 -27
  59. package/dist/configs/docs/jsdoc.d.ts +0 -27
  60. package/dist/configs/docs/jsdoc.mjs +0 -7
  61. package/dist/configs/docs/markdown.cjs +0 -164
  62. package/dist/configs/docs/markdown.d.cts +0 -35
  63. package/dist/configs/docs/markdown.d.ts +0 -35
  64. package/dist/configs/docs/markdown.mjs +0 -8
  65. package/dist/configs/formatters.cjs +0 -274
  66. package/dist/configs/formatters.d.cts +0 -11
  67. package/dist/configs/formatters.d.ts +0 -11
  68. package/dist/configs/formatters.mjs +0 -9
  69. package/dist/configs/frameworks/astro.cjs +0 -179
  70. package/dist/configs/frameworks/astro.d.cts +0 -11
  71. package/dist/configs/frameworks/astro.d.ts +0 -11
  72. package/dist/configs/frameworks/astro.mjs +0 -8
  73. package/dist/configs/frameworks/nextjs.cjs +0 -180
  74. package/dist/configs/frameworks/nextjs.d.cts +0 -11
  75. package/dist/configs/frameworks/nextjs.d.ts +0 -11
  76. package/dist/configs/frameworks/nextjs.mjs +0 -8
  77. package/dist/configs/frameworks/react.cjs +0 -377
  78. package/dist/configs/frameworks/react.d.cts +0 -11
  79. package/dist/configs/frameworks/react.d.ts +0 -11
  80. package/dist/configs/frameworks/react.mjs +0 -8
  81. package/dist/configs/frameworks/solid.cjs +0 -360
  82. package/dist/configs/frameworks/solid.d.cts +0 -11
  83. package/dist/configs/frameworks/solid.d.ts +0 -11
  84. package/dist/configs/frameworks/solid.mjs +0 -8
  85. package/dist/configs/frameworks/vue.cjs +0 -293
  86. package/dist/configs/frameworks/vue.d.cts +0 -11
  87. package/dist/configs/frameworks/vue.d.ts +0 -11
  88. package/dist/configs/frameworks/vue.mjs +0 -8
  89. package/dist/configs/ignores.cjs +0 -96
  90. package/dist/configs/ignores.d.cts +0 -15
  91. package/dist/configs/ignores.d.ts +0 -15
  92. package/dist/configs/ignores.mjs +0 -7
  93. package/dist/configs/imports.cjs +0 -104
  94. package/dist/configs/imports.d.cts +0 -23
  95. package/dist/configs/imports.d.ts +0 -23
  96. package/dist/configs/imports.mjs +0 -7
  97. package/dist/configs/index.d.cts +0 -19
  98. package/dist/configs/index.d.ts +0 -19
  99. package/dist/configs/index.mjs +0 -99
  100. package/dist/configs/javascript.cjs +0 -324
  101. package/dist/configs/javascript.d.cts +0 -11
  102. package/dist/configs/javascript.d.ts +0 -11
  103. package/dist/configs/javascript.mjs +0 -7
  104. package/dist/configs/node.cjs +0 -60
  105. package/dist/configs/node.d.cts +0 -15
  106. package/dist/configs/node.d.ts +0 -15
  107. package/dist/configs/node.mjs +0 -6
  108. package/dist/configs/sort.cjs +0 -240
  109. package/dist/configs/sort.d.cts +0 -26
  110. package/dist/configs/sort.d.ts +0 -26
  111. package/dist/configs/sort.mjs +0 -8
  112. package/dist/configs/stylistic.cjs +0 -98
  113. package/dist/configs/stylistic.d.cts +0 -11
  114. package/dist/configs/stylistic.d.ts +0 -11
  115. package/dist/configs/stylistic.mjs +0 -9
  116. package/dist/configs/test.cjs +0 -210
  117. package/dist/configs/test.d.cts +0 -11
  118. package/dist/configs/test.d.ts +0 -11
  119. package/dist/configs/test.mjs +0 -8
  120. package/dist/configs/typescript.cjs +0 -291
  121. package/dist/configs/typescript.d.cts +0 -11
  122. package/dist/configs/typescript.d.ts +0 -11
  123. package/dist/configs/typescript.mjs +0 -8
  124. package/dist/configs/unicorn.cjs +0 -91
  125. package/dist/configs/unicorn.d.cts +0 -15
  126. package/dist/configs/unicorn.d.ts +0 -15
  127. package/dist/configs/unicorn.mjs +0 -6
  128. package/dist/globs.cjs +0 -158
  129. package/dist/globs.d.cts +0 -28
  130. package/dist/globs.d.ts +0 -28
  131. package/dist/globs.mjs +0 -56
  132. package/dist/index.mjs +0 -278
  133. package/dist/types-HqEzZfQU.d.cts +0 -668
  134. package/dist/types-HqEzZfQU.d.ts +0 -668
@@ -1,360 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/configs/frameworks/solid.ts
31
- var solid_exports = {};
32
- __export(solid_exports, {
33
- solid: () => solid
34
- });
35
- module.exports = __toCommonJS(solid_exports);
36
-
37
- // src/globs.ts
38
- var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
39
- var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
40
- var GLOB_JSX = "**/*.?([cm])jsx";
41
- var GLOB_TSX = "**/*.?([cm])tsx";
42
- var GLOB_MARKDOWN = "**/*.md";
43
- var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
44
- var GLOB_TESTS = [
45
- `**/__tests__/**/*.${GLOB_SRC_EXT}`,
46
- `**/*.spec.${GLOB_SRC_EXT}`,
47
- `**/*.test.${GLOB_SRC_EXT}`,
48
- `**/*.bench.${GLOB_SRC_EXT}`,
49
- `**/*.benchmark.${GLOB_SRC_EXT}`
50
- ];
51
- var GLOB_NEXTJS_ROUTES = [
52
- `**/app/**/page.${GLOB_SRC_EXT}`,
53
- `**/app/**/layout.${GLOB_SRC_EXT}`,
54
- `**/app/**/error.${GLOB_SRC_EXT}`,
55
- `**/app/**/template.${GLOB_SRC_EXT}`,
56
- `**/app/**/not-found.${GLOB_SRC_EXT}`,
57
- `**/app/**/loading.${GLOB_SRC_EXT}`,
58
- `**/app/**/robots.${GLOB_SRC_EXT}`,
59
- `**/app/**/sitemap.${GLOB_SRC_EXT}`,
60
- `**/pages/**/*.${GLOB_SRC_EXT}`
61
- ];
62
-
63
- // src/utils.ts
64
- var import_node_process = __toESM(require("process"), 1);
65
- var import_local_pkg = require("local-pkg");
66
- async function interop(m) {
67
- const resolved = await m;
68
- return resolved.default || resolved;
69
- }
70
- async function ensure(packages) {
71
- if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false) {
72
- return;
73
- }
74
- ;
75
- const nonExistingPackages = packages.filter((i) => !(0, import_local_pkg.isPackageExists)(i));
76
- if (nonExistingPackages.length === 0) {
77
- return;
78
- }
79
- ;
80
- const { default: prompts } = await import("prompts");
81
- const { result } = await prompts([
82
- {
83
- name: "result",
84
- message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
85
- type: "confirm"
86
- }
87
- ]);
88
- if (result) {
89
- await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, {
90
- dev: true
91
- }));
92
- }
93
- ;
94
- }
95
-
96
- // src/configs/frameworks/solid.ts
97
- async function solid(options = {}) {
98
- const {
99
- a11y = false,
100
- files = [GLOB_JSX, GLOB_TSX],
101
- overrides = {},
102
- typescript = true
103
- } = options;
104
- await ensure([
105
- "eslint-plugin-solid"
106
- ]);
107
- const [
108
- pluginSolid
109
- ] = await Promise.all([
110
- interop(import("eslint-plugin-solid"))
111
- ]);
112
- return [
113
- {
114
- name: "luxass:solid:setup",
115
- plugins: {
116
- solid: pluginSolid
117
- }
118
- },
119
- {
120
- name: "luxass:solid:rules",
121
- files,
122
- languageOptions: {
123
- parserOptions: {
124
- ecmaFeatures: {
125
- jsx: true
126
- }
127
- },
128
- sourceType: "module"
129
- },
130
- rules: {
131
- ...a11y ? {
132
- // recommended rules for jsx-a11y
133
- "jsx-a11y/alt-text": "error",
134
- "jsx-a11y/anchor-ambiguous-text": "off",
135
- "jsx-a11y/anchor-has-content": "error",
136
- "jsx-a11y/anchor-is-valid": "error",
137
- "jsx-a11y/aria-activedescendant-has-tabindex": "error",
138
- "jsx-a11y/aria-props": "error",
139
- "jsx-a11y/aria-proptypes": "error",
140
- "jsx-a11y/aria-role": "error",
141
- "jsx-a11y/aria-unsupported-elements": "error",
142
- "jsx-a11y/autocomplete-valid": "error",
143
- "jsx-a11y/click-events-have-key-events": "error",
144
- "jsx-a11y/control-has-associated-label": [
145
- "off",
146
- {
147
- ignoreElements: [
148
- "audio",
149
- "canvas",
150
- "embed",
151
- "input",
152
- "textarea",
153
- "tr",
154
- "video"
155
- ],
156
- ignoreRoles: [
157
- "grid",
158
- "listbox",
159
- "menu",
160
- "menubar",
161
- "radiogroup",
162
- "row",
163
- "tablist",
164
- "toolbar",
165
- "tree",
166
- "treegrid"
167
- ],
168
- includeRoles: [
169
- "alert",
170
- "dialog"
171
- ]
172
- }
173
- ],
174
- "jsx-a11y/heading-has-content": "error",
175
- "jsx-a11y/html-has-lang": "error",
176
- "jsx-a11y/iframe-has-title": "error",
177
- "jsx-a11y/img-redundant-alt": "error",
178
- "jsx-a11y/interactive-supports-focus": [
179
- "error",
180
- {
181
- tabbable: [
182
- "button",
183
- "checkbox",
184
- "link",
185
- "searchbox",
186
- "spinbutton",
187
- "switch",
188
- "textbox"
189
- ]
190
- }
191
- ],
192
- "jsx-a11y/label-has-associated-control": "error",
193
- "jsx-a11y/label-has-for": "off",
194
- "jsx-a11y/media-has-caption": "error",
195
- "jsx-a11y/mouse-events-have-key-events": "error",
196
- "jsx-a11y/no-access-key": "error",
197
- "jsx-a11y/no-autofocus": "error",
198
- "jsx-a11y/no-distracting-elements": "error",
199
- "jsx-a11y/no-interactive-element-to-noninteractive-role": [
200
- "error",
201
- {
202
- canvas: [
203
- "img"
204
- ],
205
- tr: [
206
- "none",
207
- "presentation"
208
- ]
209
- }
210
- ],
211
- "jsx-a11y/no-noninteractive-element-interactions": [
212
- "error",
213
- {
214
- alert: [
215
- "onKeyUp",
216
- "onKeyDown",
217
- "onKeyPress"
218
- ],
219
- body: [
220
- "onError",
221
- "onLoad"
222
- ],
223
- dialog: [
224
- "onKeyUp",
225
- "onKeyDown",
226
- "onKeyPress"
227
- ],
228
- handlers: [
229
- "onClick",
230
- "onError",
231
- "onLoad",
232
- "onMouseDown",
233
- "onMouseUp",
234
- "onKeyPress",
235
- "onKeyDown",
236
- "onKeyUp"
237
- ],
238
- iframe: [
239
- "onError",
240
- "onLoad"
241
- ],
242
- img: [
243
- "onError",
244
- "onLoad"
245
- ]
246
- }
247
- ],
248
- "jsx-a11y/no-noninteractive-element-to-interactive-role": [
249
- "error",
250
- {
251
- fieldset: [
252
- "radiogroup",
253
- "presentation"
254
- ],
255
- li: [
256
- "menuitem",
257
- "option",
258
- "row",
259
- "tab",
260
- "treeitem"
261
- ],
262
- ol: [
263
- "listbox",
264
- "menu",
265
- "menubar",
266
- "radiogroup",
267
- "tablist",
268
- "tree",
269
- "treegrid"
270
- ],
271
- table: [
272
- "grid"
273
- ],
274
- td: [
275
- "gridcell"
276
- ],
277
- ul: [
278
- "listbox",
279
- "menu",
280
- "menubar",
281
- "radiogroup",
282
- "tablist",
283
- "tree",
284
- "treegrid"
285
- ]
286
- }
287
- ],
288
- "jsx-a11y/no-noninteractive-tabindex": [
289
- "error",
290
- {
291
- allowExpressionValues: true,
292
- roles: [
293
- "tabpanel"
294
- ],
295
- tags: []
296
- }
297
- ],
298
- "jsx-a11y/no-redundant-roles": "error",
299
- "jsx-a11y/no-static-element-interactions": [
300
- "error",
301
- {
302
- allowExpressionValues: true,
303
- handlers: [
304
- "onClick",
305
- "onMouseDown",
306
- "onMouseUp",
307
- "onKeyPress",
308
- "onKeyDown",
309
- "onKeyUp"
310
- ]
311
- }
312
- ],
313
- "jsx-a11y/role-has-required-aria-props": "error",
314
- "jsx-a11y/role-supports-aria-props": "error",
315
- "jsx-a11y/scope": "error",
316
- "jsx-a11y/tabindex-no-positive": "error"
317
- } : {},
318
- // solid recommended rules
319
- // reactivity
320
- "solid/components-return-once": 1,
321
- "solid/event-handlers": 1,
322
- // these rules are mostly style suggestions
323
- "solid/imports": 1,
324
- // identifier usage is important
325
- "solid/jsx-no-duplicate-props": 2,
326
- "solid/jsx-no-script-url": 2,
327
- "solid/jsx-no-undef": 2,
328
- "solid/jsx-uses-vars": 2,
329
- "solid/no-array-handlers": 0,
330
- "solid/no-destructure": 2,
331
- // security problems
332
- "solid/no-innerhtml": 2,
333
- // only necessary for resource-constrained environments
334
- "solid/no-proxy-apis": 0,
335
- "solid/no-react-deps": 1,
336
- "solid/no-react-specific-props": 1,
337
- "solid/no-unknown-namespaces": 2,
338
- // deprecated
339
- "solid/prefer-classlist": 0,
340
- "solid/prefer-for": 2,
341
- // handled by Solid compiler, opt-in style suggestion
342
- "solid/prefer-show": 0,
343
- "solid/reactivity": 1,
344
- "solid/self-closing-comp": 1,
345
- "solid/style-prop": 1,
346
- ...typescript ? {
347
- "solid/jsx-no-undef": [2, { typescriptEnabled: true }],
348
- // namespaces taken care of by TS
349
- "solid/no-unknown-namespaces": 0
350
- } : {},
351
- // overrides
352
- ...overrides
353
- }
354
- }
355
- ];
356
- }
357
- // Annotate the CommonJS export names for ESM import in node:
358
- 0 && (module.exports = {
359
- solid
360
- });
@@ -1,11 +0,0 @@
1
- export { o as SolidOptions, m as solid } from '../../types-HqEzZfQU.cjs';
2
- import 'eslint-config-flat-gitignore';
3
- import '@antfu/eslint-define-config';
4
- import '@eslint-types/jsdoc/types';
5
- import '@eslint-types/typescript-eslint/types';
6
- import '@eslint-types/unicorn/types';
7
- import 'eslint-plugin-antfu';
8
- import '@stylistic/eslint-plugin';
9
- import 'eslint';
10
- import '@typescript-eslint/parser';
11
- import 'eslint-processor-vue-blocks';
@@ -1,11 +0,0 @@
1
- export { o as SolidOptions, m as solid } from '../../types-HqEzZfQU.js';
2
- import 'eslint-config-flat-gitignore';
3
- import '@antfu/eslint-define-config';
4
- import '@eslint-types/jsdoc/types';
5
- import '@eslint-types/typescript-eslint/types';
6
- import '@eslint-types/unicorn/types';
7
- import 'eslint-plugin-antfu';
8
- import '@stylistic/eslint-plugin';
9
- import 'eslint';
10
- import '@typescript-eslint/parser';
11
- import 'eslint-processor-vue-blocks';
@@ -1,8 +0,0 @@
1
- import {
2
- solid
3
- } from "../../chunk-XD3UVRU7.mjs";
4
- import "../../chunk-4YBQZLPS.mjs";
5
- import "../../chunk-KOXCJL3C.mjs";
6
- export {
7
- solid
8
- };
@@ -1,293 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/configs/frameworks/vue.ts
31
- var vue_exports = {};
32
- __export(vue_exports, {
33
- vue: () => vue
34
- });
35
- module.exports = __toCommonJS(vue_exports);
36
- var import_eslint_merge_processors = require("eslint-merge-processors");
37
-
38
- // src/globs.ts
39
- var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
40
- var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
41
- var GLOB_MARKDOWN = "**/*.md";
42
- var GLOB_VUE = "**/*.vue";
43
- var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
44
- var GLOB_TESTS = [
45
- `**/__tests__/**/*.${GLOB_SRC_EXT}`,
46
- `**/*.spec.${GLOB_SRC_EXT}`,
47
- `**/*.test.${GLOB_SRC_EXT}`,
48
- `**/*.bench.${GLOB_SRC_EXT}`,
49
- `**/*.benchmark.${GLOB_SRC_EXT}`
50
- ];
51
- var GLOB_NEXTJS_ROUTES = [
52
- `**/app/**/page.${GLOB_SRC_EXT}`,
53
- `**/app/**/layout.${GLOB_SRC_EXT}`,
54
- `**/app/**/error.${GLOB_SRC_EXT}`,
55
- `**/app/**/template.${GLOB_SRC_EXT}`,
56
- `**/app/**/not-found.${GLOB_SRC_EXT}`,
57
- `**/app/**/loading.${GLOB_SRC_EXT}`,
58
- `**/app/**/robots.${GLOB_SRC_EXT}`,
59
- `**/app/**/sitemap.${GLOB_SRC_EXT}`,
60
- `**/pages/**/*.${GLOB_SRC_EXT}`
61
- ];
62
-
63
- // src/utils.ts
64
- var import_node_process = __toESM(require("process"), 1);
65
- var import_local_pkg = require("local-pkg");
66
- async function interop(m) {
67
- const resolved = await m;
68
- return resolved.default || resolved;
69
- }
70
- async function ensure(packages) {
71
- if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false) {
72
- return;
73
- }
74
- ;
75
- const nonExistingPackages = packages.filter((i) => !(0, import_local_pkg.isPackageExists)(i));
76
- if (nonExistingPackages.length === 0) {
77
- return;
78
- }
79
- ;
80
- const { default: prompts } = await import("prompts");
81
- const { result } = await prompts([
82
- {
83
- name: "result",
84
- message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
85
- type: "confirm"
86
- }
87
- ]);
88
- if (result) {
89
- await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, {
90
- dev: true
91
- }));
92
- }
93
- ;
94
- }
95
-
96
- // src/configs/frameworks/vue.ts
97
- async function vue(options = {}) {
98
- const {
99
- a11y = false,
100
- files = [GLOB_VUE],
101
- overrides = {},
102
- stylistic = true
103
- } = options;
104
- if (a11y) {
105
- await ensure(["eslint-plugin-vuejs-accessibility"]);
106
- }
107
- const [
108
- pluginVue,
109
- parserVue,
110
- processorVueBlocks,
111
- pluginA11y
112
- ] = await Promise.all([
113
- interop(import("eslint-plugin-vue")),
114
- interop(import("vue-eslint-parser")),
115
- interop(import("eslint-processor-vue-blocks")),
116
- ...a11y ? [interop(import("eslint-plugin-vuejs-accessibility"))] : []
117
- ]);
118
- const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
119
- const {
120
- indent = 2
121
- } = typeof stylistic === "boolean" ? {} : stylistic;
122
- return [
123
- {
124
- name: "luxass:vue:setup",
125
- plugins: {
126
- vue: pluginVue,
127
- ...a11y ? { "vue-a11y": pluginA11y } : {}
128
- }
129
- },
130
- {
131
- name: "luxass:vue:rules",
132
- files,
133
- languageOptions: {
134
- parser: parserVue,
135
- parserOptions: {
136
- ecmaFeatures: {
137
- jsx: true
138
- },
139
- extraFileExtensions: [".vue"],
140
- parser: options.typescript ? await interop(import("@typescript-eslint/parser")) : null,
141
- sourceType: "module"
142
- }
143
- },
144
- processor: sfcBlocks === false ? pluginVue.processors[".vue"] : (0, import_eslint_merge_processors.mergeProcessors)([
145
- pluginVue.processors[".vue"],
146
- processorVueBlocks({
147
- ...sfcBlocks,
148
- blocks: {
149
- styles: true,
150
- ...sfcBlocks.blocks
151
- }
152
- })
153
- ]),
154
- rules: {
155
- ...pluginVue.configs.base.rules,
156
- ...pluginVue.configs["vue3-essential"].rules,
157
- ...pluginVue.configs["vue3-strongly-recommended"].rules,
158
- ...pluginVue.configs["vue3-recommended"].rules,
159
- "node/prefer-global/process": "off",
160
- "vue/block-order": [
161
- "error",
162
- {
163
- order: ["script", "template", "style"]
164
- }
165
- ],
166
- "vue/component-name-in-template-casing": ["error", "PascalCase"],
167
- "vue/component-options-name-casing": ["error", "PascalCase"],
168
- // this is deprecated
169
- "vue/component-tags-order": "off",
170
- "vue/custom-event-name-casing": ["error", "camelCase"],
171
- "vue/define-macros-order": [
172
- "error",
173
- {
174
- order: [
175
- "defineOptions",
176
- "defineProps",
177
- "defineEmits",
178
- "defineSlots"
179
- ]
180
- }
181
- ],
182
- "vue/dot-location": ["error", "property"],
183
- "vue/dot-notation": ["error", { allowKeywords: true }],
184
- "vue/eqeqeq": ["error", "smart"],
185
- "vue/html-indent": ["error", indent],
186
- "vue/html-quotes": ["error", "double"],
187
- "vue/max-attributes-per-line": "off",
188
- "vue/multi-word-component-names": "off",
189
- "vue/no-dupe-keys": "off",
190
- "vue/no-empty-pattern": "error",
191
- "vue/no-irregular-whitespace": "error",
192
- "vue/no-loss-of-precision": "error",
193
- "vue/no-restricted-syntax": [
194
- "error",
195
- "DebuggerStatement",
196
- "LabeledStatement",
197
- "WithStatement"
198
- ],
199
- "vue/no-restricted-v-bind": ["error", "/^v-/"],
200
- "vue/no-setup-props-reactivity-loss": "off",
201
- "vue/no-sparse-arrays": "error",
202
- "vue/no-unused-refs": "error",
203
- "vue/no-useless-v-bind": "error",
204
- "vue/no-v-html": "off",
205
- "vue/object-shorthand": [
206
- "error",
207
- "always",
208
- {
209
- avoidQuotes: true,
210
- ignoreConstructors: false
211
- }
212
- ],
213
- "vue/prefer-separate-static-class": "error",
214
- "vue/prefer-template": "error",
215
- "vue/prop-name-casing": ["error", "camelCase"],
216
- "vue/require-default-prop": "off",
217
- "vue/require-prop-types": "off",
218
- "vue/space-infix-ops": "error",
219
- "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
220
- ...stylistic ? {
221
- "vue/array-bracket-spacing": ["error", "never"],
222
- "vue/arrow-spacing": ["error", { after: true, before: true }],
223
- "vue/block-spacing": ["error", "always"],
224
- "vue/block-tag-newline": [
225
- "error",
226
- {
227
- multiline: "always",
228
- singleline: "always"
229
- }
230
- ],
231
- "vue/brace-style": [
232
- "error",
233
- "stroustrup",
234
- { allowSingleLine: true }
235
- ],
236
- "vue/comma-dangle": ["error", "always-multiline"],
237
- "vue/comma-spacing": ["error", { after: true, before: false }],
238
- "vue/comma-style": ["error", "last"],
239
- "vue/html-comment-content-spacing": [
240
- "error",
241
- "always",
242
- {
243
- exceptions: ["-"]
244
- }
245
- ],
246
- "vue/key-spacing": [
247
- "error",
248
- { afterColon: true, beforeColon: false }
249
- ],
250
- "vue/keyword-spacing": ["error", { after: true, before: true }],
251
- "vue/object-curly-newline": "off",
252
- "vue/object-curly-spacing": ["error", "always"],
253
- "vue/object-property-newline": [
254
- "error",
255
- { allowMultiplePropertiesPerLine: true }
256
- ],
257
- "vue/operator-linebreak": ["error", "before"],
258
- "vue/padding-line-between-blocks": ["error", "always"],
259
- "vue/quote-props": ["error", "consistent-as-needed"],
260
- "vue/space-in-parens": ["error", "never"],
261
- "vue/template-curly-spacing": "error"
262
- } : {},
263
- ...a11y ? {
264
- "vue-a11y/alt-text": "error",
265
- "vue-a11y/anchor-has-content": "error",
266
- "vue-a11y/aria-props": "error",
267
- "vue-a11y/aria-role": "error",
268
- "vue-a11y/aria-unsupported-elements": "error",
269
- "vue-a11y/click-events-have-key-events": "error",
270
- "vue-a11y/form-control-has-label": "error",
271
- "vue-a11y/heading-has-content": "error",
272
- "vue-a11y/iframe-has-title": "error",
273
- "vue-a11y/interactive-supports-focus": "error",
274
- "vue-a11y/label-has-for": "error",
275
- "vue-a11y/media-has-caption": "error",
276
- "vue-a11y/mouse-events-have-key-events": "error",
277
- "vue-a11y/no-access-key": "error",
278
- "vue-a11y/no-autofocus": "error",
279
- "vue-a11y/no-distracting-elements": "error",
280
- "vue-a11y/no-redundant-roles": "error",
281
- "vue-a11y/no-static-element-interactions": "error",
282
- "vue-a11y/role-has-required-aria-props": "error",
283
- "vue-a11y/tabindex-no-positive": "error"
284
- } : {},
285
- ...overrides
286
- }
287
- }
288
- ];
289
- }
290
- // Annotate the CommonJS export names for ESM import in node:
291
- 0 && (module.exports = {
292
- vue
293
- });