@luxass/eslint-config 4.2.6 → 4.2.7

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 +145 -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} +288 -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,377 +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/react.ts
31
- var react_exports = {};
32
- __export(react_exports, {
33
- react: () => react
34
- });
35
- module.exports = __toCommonJS(react_exports);
36
- var import_local_pkg2 = require("local-pkg");
37
-
38
- // src/globs.ts
39
- var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
40
- var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
41
- var GLOB_JSX = "**/*.?([cm])jsx";
42
- var GLOB_TSX = "**/*.?([cm])tsx";
43
- var GLOB_MARKDOWN = "**/*.md";
44
- var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
45
- var GLOB_TESTS = [
46
- `**/__tests__/**/*.${GLOB_SRC_EXT}`,
47
- `**/*.spec.${GLOB_SRC_EXT}`,
48
- `**/*.test.${GLOB_SRC_EXT}`,
49
- `**/*.bench.${GLOB_SRC_EXT}`,
50
- `**/*.benchmark.${GLOB_SRC_EXT}`
51
- ];
52
- var GLOB_NEXTJS_ROUTES = [
53
- `**/app/**/page.${GLOB_SRC_EXT}`,
54
- `**/app/**/layout.${GLOB_SRC_EXT}`,
55
- `**/app/**/error.${GLOB_SRC_EXT}`,
56
- `**/app/**/template.${GLOB_SRC_EXT}`,
57
- `**/app/**/not-found.${GLOB_SRC_EXT}`,
58
- `**/app/**/loading.${GLOB_SRC_EXT}`,
59
- `**/app/**/robots.${GLOB_SRC_EXT}`,
60
- `**/app/**/sitemap.${GLOB_SRC_EXT}`,
61
- `**/pages/**/*.${GLOB_SRC_EXT}`
62
- ];
63
-
64
- // src/utils.ts
65
- var import_node_process = __toESM(require("process"), 1);
66
- var import_local_pkg = require("local-pkg");
67
- async function interop(m) {
68
- const resolved = await m;
69
- return resolved.default || resolved;
70
- }
71
- async function ensure(packages) {
72
- if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false) {
73
- return;
74
- }
75
- ;
76
- const nonExistingPackages = packages.filter((i) => !(0, import_local_pkg.isPackageExists)(i));
77
- if (nonExistingPackages.length === 0) {
78
- return;
79
- }
80
- ;
81
- const { default: prompts } = await import("prompts");
82
- const { result } = await prompts([
83
- {
84
- name: "result",
85
- message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
86
- type: "confirm"
87
- }
88
- ]);
89
- if (result) {
90
- await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, {
91
- dev: true
92
- }));
93
- }
94
- ;
95
- }
96
-
97
- // src/configs/frameworks/react.ts
98
- async function react(options = {}) {
99
- const {
100
- a11y = false,
101
- files = [GLOB_JSX, GLOB_TSX],
102
- overrides = {},
103
- typescript = true
104
- } = options;
105
- await ensure([
106
- "eslint-plugin-react",
107
- "eslint-plugin-react-hooks",
108
- "eslint-plugin-react-refresh",
109
- ...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
110
- ]);
111
- const [
112
- pluginReact,
113
- pluginReactHooks,
114
- pluginReactRefresh,
115
- pluginA11y
116
- ] = await Promise.all([
117
- interop(import("eslint-plugin-react")),
118
- interop(import("eslint-plugin-react-hooks")),
119
- interop(import("eslint-plugin-react-refresh")),
120
- ...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
121
- ]);
122
- const isAllowConstantExport = (0, import_local_pkg2.isPackageExists)("vite");
123
- return [
124
- {
125
- name: "luxass:react:setup",
126
- plugins: {
127
- "react": pluginReact,
128
- "react-hooks": pluginReactHooks,
129
- "react-refresh": pluginReactRefresh,
130
- ...a11y ? { "jsx-a11y": pluginA11y } : {}
131
- }
132
- },
133
- {
134
- name: "luxass:react:rules",
135
- files,
136
- languageOptions: {
137
- parserOptions: {
138
- ecmaFeatures: {
139
- jsx: true
140
- }
141
- }
142
- },
143
- rules: {
144
- ...a11y ? {
145
- // recommended rules for jsx-a11y
146
- "jsx-a11y/alt-text": "error",
147
- "jsx-a11y/anchor-ambiguous-text": "off",
148
- "jsx-a11y/anchor-has-content": "error",
149
- "jsx-a11y/anchor-is-valid": "error",
150
- "jsx-a11y/aria-activedescendant-has-tabindex": "error",
151
- "jsx-a11y/aria-props": "error",
152
- "jsx-a11y/aria-proptypes": "error",
153
- "jsx-a11y/aria-role": "error",
154
- "jsx-a11y/aria-unsupported-elements": "error",
155
- "jsx-a11y/autocomplete-valid": "error",
156
- "jsx-a11y/click-events-have-key-events": "error",
157
- "jsx-a11y/control-has-associated-label": [
158
- "off",
159
- {
160
- ignoreElements: [
161
- "audio",
162
- "canvas",
163
- "embed",
164
- "input",
165
- "textarea",
166
- "tr",
167
- "video"
168
- ],
169
- ignoreRoles: [
170
- "grid",
171
- "listbox",
172
- "menu",
173
- "menubar",
174
- "radiogroup",
175
- "row",
176
- "tablist",
177
- "toolbar",
178
- "tree",
179
- "treegrid"
180
- ],
181
- includeRoles: [
182
- "alert",
183
- "dialog"
184
- ]
185
- }
186
- ],
187
- "jsx-a11y/heading-has-content": "error",
188
- "jsx-a11y/html-has-lang": "error",
189
- "jsx-a11y/iframe-has-title": "error",
190
- "jsx-a11y/img-redundant-alt": "error",
191
- "jsx-a11y/interactive-supports-focus": [
192
- "error",
193
- {
194
- tabbable: [
195
- "button",
196
- "checkbox",
197
- "link",
198
- "searchbox",
199
- "spinbutton",
200
- "switch",
201
- "textbox"
202
- ]
203
- }
204
- ],
205
- "jsx-a11y/label-has-associated-control": "error",
206
- "jsx-a11y/label-has-for": "off",
207
- "jsx-a11y/media-has-caption": "error",
208
- "jsx-a11y/mouse-events-have-key-events": "error",
209
- "jsx-a11y/no-access-key": "error",
210
- "jsx-a11y/no-autofocus": "error",
211
- "jsx-a11y/no-distracting-elements": "error",
212
- "jsx-a11y/no-interactive-element-to-noninteractive-role": [
213
- "error",
214
- {
215
- canvas: [
216
- "img"
217
- ],
218
- tr: [
219
- "none",
220
- "presentation"
221
- ]
222
- }
223
- ],
224
- "jsx-a11y/no-noninteractive-element-interactions": [
225
- "error",
226
- {
227
- alert: [
228
- "onKeyUp",
229
- "onKeyDown",
230
- "onKeyPress"
231
- ],
232
- body: [
233
- "onError",
234
- "onLoad"
235
- ],
236
- dialog: [
237
- "onKeyUp",
238
- "onKeyDown",
239
- "onKeyPress"
240
- ],
241
- handlers: [
242
- "onClick",
243
- "onError",
244
- "onLoad",
245
- "onMouseDown",
246
- "onMouseUp",
247
- "onKeyPress",
248
- "onKeyDown",
249
- "onKeyUp"
250
- ],
251
- iframe: [
252
- "onError",
253
- "onLoad"
254
- ],
255
- img: [
256
- "onError",
257
- "onLoad"
258
- ]
259
- }
260
- ],
261
- "jsx-a11y/no-noninteractive-element-to-interactive-role": [
262
- "error",
263
- {
264
- fieldset: [
265
- "radiogroup",
266
- "presentation"
267
- ],
268
- li: [
269
- "menuitem",
270
- "option",
271
- "row",
272
- "tab",
273
- "treeitem"
274
- ],
275
- ol: [
276
- "listbox",
277
- "menu",
278
- "menubar",
279
- "radiogroup",
280
- "tablist",
281
- "tree",
282
- "treegrid"
283
- ],
284
- table: [
285
- "grid"
286
- ],
287
- td: [
288
- "gridcell"
289
- ],
290
- ul: [
291
- "listbox",
292
- "menu",
293
- "menubar",
294
- "radiogroup",
295
- "tablist",
296
- "tree",
297
- "treegrid"
298
- ]
299
- }
300
- ],
301
- "jsx-a11y/no-noninteractive-tabindex": [
302
- "error",
303
- {
304
- allowExpressionValues: true,
305
- roles: [
306
- "tabpanel"
307
- ],
308
- tags: []
309
- }
310
- ],
311
- "jsx-a11y/no-redundant-roles": "error",
312
- "jsx-a11y/no-static-element-interactions": [
313
- "error",
314
- {
315
- allowExpressionValues: true,
316
- handlers: [
317
- "onClick",
318
- "onMouseDown",
319
- "onMouseUp",
320
- "onKeyPress",
321
- "onKeyDown",
322
- "onKeyUp"
323
- ]
324
- }
325
- ],
326
- "jsx-a11y/role-has-required-aria-props": "error",
327
- "jsx-a11y/role-supports-aria-props": "error",
328
- "jsx-a11y/scope": "error",
329
- "jsx-a11y/tabindex-no-positive": "error"
330
- } : {},
331
- // recommended rules react
332
- "react/display-name": "error",
333
- "react/jsx-key": "error",
334
- "react/jsx-no-comment-textnodes": "error",
335
- "react/jsx-no-duplicate-props": "error",
336
- "react/jsx-no-target-blank": "error",
337
- "react/jsx-no-undef": "error",
338
- "react/jsx-uses-react": "error",
339
- "react/jsx-uses-vars": "error",
340
- "react/no-children-prop": "error",
341
- "react/no-danger-with-children": "error",
342
- "react/no-deprecated": "error",
343
- "react/no-direct-mutation-state": "error",
344
- "react/no-find-dom-node": "error",
345
- "react/no-is-mounted": "error",
346
- "react/no-render-return-value": "error",
347
- "react/no-string-refs": "error",
348
- "react/no-unescaped-entities": "error",
349
- "react/no-unknown-property": "error",
350
- "react/no-unsafe": "off",
351
- "react/prop-types": "error",
352
- "react/react-in-jsx-scope": "off",
353
- "react/require-render-return": "error",
354
- // recommended rules react-hooks
355
- "react-hooks/exhaustive-deps": "warn",
356
- "react-hooks/rules-of-hooks": "error",
357
- // react refresh
358
- "react-refresh/only-export-components": ["warn", { allowConstantExport: isAllowConstantExport }],
359
- ...typescript ? {
360
- "react/jsx-no-undef": "off",
361
- "react/prop-type": "off"
362
- } : {},
363
- // overrides
364
- ...overrides
365
- },
366
- settings: {
367
- react: {
368
- version: "detect"
369
- }
370
- }
371
- }
372
- ];
373
- }
374
- // Annotate the CommonJS export names for ESM import in node:
375
- 0 && (module.exports = {
376
- react
377
- });
@@ -1,11 +0,0 @@
1
- export { R as ReactOptions, r as react } 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 { R as ReactOptions, r as react } 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
- react
3
- } from "../../chunk-47ISSTHW.mjs";
4
- import "../../chunk-4YBQZLPS.mjs";
5
- import "../../chunk-KOXCJL3C.mjs";
6
- export {
7
- react
8
- };