@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,240 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/configs/sort.ts
21
- var sort_exports = {};
22
- __export(sort_exports, {
23
- sortPackageJson: () => sortPackageJson,
24
- sortTsconfig: () => sortTsconfig
25
- });
26
- module.exports = __toCommonJS(sort_exports);
27
- function sortPackageJson() {
28
- return [
29
- {
30
- name: "luxass:sort-package-json",
31
- files: ["**/package.json"],
32
- rules: {
33
- "jsonc/sort-array-values": [
34
- "error",
35
- {
36
- order: { type: "asc" },
37
- pathPattern: "^files$"
38
- }
39
- ],
40
- "jsonc/sort-keys": [
41
- "error",
42
- {
43
- order: [
44
- "name",
45
- "displayName",
46
- "version",
47
- "description",
48
- "type",
49
- "private",
50
- "author",
51
- "publisher",
52
- "packageManager",
53
- "license",
54
- "funding",
55
- "homepage",
56
- "repository",
57
- "bugs",
58
- "keywords",
59
- "categories",
60
- "sideEffects",
61
- "exports",
62
- "main",
63
- "module",
64
- "unpkg",
65
- "jsdelivr",
66
- "types",
67
- "typesVersions",
68
- "bin",
69
- "icon",
70
- "files",
71
- "engines",
72
- "activationEvents",
73
- "contributes",
74
- "scripts",
75
- "peerDependencies",
76
- "peerDependenciesMeta",
77
- "dependencies",
78
- "optionalDependencies",
79
- "devDependencies",
80
- "pnpm",
81
- "overrides",
82
- "resolutions",
83
- "husky",
84
- "simple-git-hooks",
85
- "lint-staged",
86
- "eslintConfig"
87
- ],
88
- pathPattern: "^$"
89
- },
90
- {
91
- order: { type: "asc" },
92
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
93
- },
94
- {
95
- order: { type: "asc" },
96
- pathPattern: "^resolutions$"
97
- },
98
- {
99
- order: { type: "asc" },
100
- pathPattern: "^pnpm.overrides$"
101
- },
102
- {
103
- order: ["types", "import", "require", "default"],
104
- pathPattern: "^exports.*$"
105
- }
106
- ]
107
- }
108
- }
109
- ];
110
- }
111
- function sortTsconfig() {
112
- return [
113
- {
114
- name: "luxass:sort-tsconfig",
115
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
116
- rules: {
117
- "jsonc/sort-keys": [
118
- "error",
119
- {
120
- order: [
121
- "extends",
122
- "compilerOptions",
123
- "references",
124
- "files",
125
- "include",
126
- "exclude"
127
- ],
128
- pathPattern: "^$"
129
- },
130
- {
131
- order: [
132
- /* Projects */
133
- "incremental",
134
- "composite",
135
- "tsBuildInfoFile",
136
- "disableSourceOfProjectReferenceRedirect",
137
- "disableSolutionSearching",
138
- "disableReferencedProjectLoad",
139
- /* Language and Environment */
140
- "target",
141
- "jsx",
142
- "jsxFactory",
143
- "jsxFragmentFactory",
144
- "jsxImportSource",
145
- "lib",
146
- "moduleDetection",
147
- "noLib",
148
- "reactNamespace",
149
- "useDefineForClassFields",
150
- "emitDecoratorMetadata",
151
- "experimentalDecorators",
152
- /* Modules */
153
- "baseUrl",
154
- "rootDir",
155
- "rootDirs",
156
- "customConditions",
157
- "module",
158
- "moduleResolution",
159
- "moduleSuffixes",
160
- "noResolve",
161
- "paths",
162
- "resolveJsonModule",
163
- "resolvePackageJsonExports",
164
- "resolvePackageJsonImports",
165
- "typeRoots",
166
- "types",
167
- "allowArbitraryExtensions",
168
- "allowImportingTsExtensions",
169
- "allowUmdGlobalAccess",
170
- /* JavaScript Support */
171
- "allowJs",
172
- "checkJs",
173
- "maxNodeModuleJsDepth",
174
- /* Type Checking */
175
- "strict",
176
- "strictBindCallApply",
177
- "strictFunctionTypes",
178
- "strictNullChecks",
179
- "strictPropertyInitialization",
180
- "allowUnreachableCode",
181
- "allowUnusedLabels",
182
- "alwaysStrict",
183
- "exactOptionalPropertyTypes",
184
- "noFallthroughCasesInSwitch",
185
- "noImplicitAny",
186
- "noImplicitOverride",
187
- "noImplicitReturns",
188
- "noImplicitThis",
189
- "noPropertyAccessFromIndexSignature",
190
- "noUncheckedIndexedAccess",
191
- "noUnusedLocals",
192
- "noUnusedParameters",
193
- "useUnknownInCatchVariables",
194
- /* Emit */
195
- "declaration",
196
- "declarationDir",
197
- "declarationMap",
198
- "downlevelIteration",
199
- "emitBOM",
200
- "emitDeclarationOnly",
201
- "importHelpers",
202
- "importsNotUsedAsValues",
203
- "inlineSourceMap",
204
- "inlineSources",
205
- "mapRoot",
206
- "newLine",
207
- "noEmit",
208
- "noEmitHelpers",
209
- "noEmitOnError",
210
- "outDir",
211
- "outFile",
212
- "preserveConstEnums",
213
- "preserveValueImports",
214
- "removeComments",
215
- "sourceMap",
216
- "sourceRoot",
217
- "stripInternal",
218
- /* Interop Constraints */
219
- "allowSyntheticDefaultImports",
220
- "esModuleInterop",
221
- "forceConsistentCasingInFileNames",
222
- "isolatedModules",
223
- "preserveSymlinks",
224
- "verbatimModuleSyntax",
225
- /* Completeness */
226
- "skipDefaultLibCheck",
227
- "skipLibCheck"
228
- ],
229
- pathPattern: "^compilerOptions$"
230
- }
231
- ]
232
- }
233
- }
234
- ];
235
- }
236
- // Annotate the CommonJS export names for ESM import in node:
237
- 0 && (module.exports = {
238
- sortPackageJson,
239
- sortTsconfig
240
- });
@@ -1,26 +0,0 @@
1
- import { p as FlatConfigItem } 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';
12
-
13
- /**
14
- * Sort package.json
15
- *
16
- * Requires `jsonc` config
17
- */
18
- declare function sortPackageJson(): FlatConfigItem[];
19
- /**
20
- * Sort tsconfig.json
21
- *
22
- * Requires `jsonc` config
23
- */
24
- declare function sortTsconfig(): FlatConfigItem[];
25
-
26
- export { sortPackageJson, sortTsconfig };
@@ -1,26 +0,0 @@
1
- import { p as FlatConfigItem } 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';
12
-
13
- /**
14
- * Sort package.json
15
- *
16
- * Requires `jsonc` config
17
- */
18
- declare function sortPackageJson(): FlatConfigItem[];
19
- /**
20
- * Sort tsconfig.json
21
- *
22
- * Requires `jsonc` config
23
- */
24
- declare function sortTsconfig(): FlatConfigItem[];
25
-
26
- export { sortPackageJson, sortTsconfig };
@@ -1,8 +0,0 @@
1
- import {
2
- sortPackageJson,
3
- sortTsconfig
4
- } from "../chunk-XBASVDU6.mjs";
5
- export {
6
- sortPackageJson,
7
- sortTsconfig
8
- };
@@ -1,98 +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/stylistic.ts
31
- var stylistic_exports = {};
32
- __export(stylistic_exports, {
33
- StylisticConfigDefaults: () => StylisticConfigDefaults,
34
- stylistic: () => stylistic
35
- });
36
- module.exports = __toCommonJS(stylistic_exports);
37
- var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
38
-
39
- // src/utils.ts
40
- var import_node_process = __toESM(require("process"), 1);
41
- var import_local_pkg = require("local-pkg");
42
- async function interop(m) {
43
- const resolved = await m;
44
- return resolved.default || resolved;
45
- }
46
-
47
- // src/configs/stylistic.ts
48
- var StylisticConfigDefaults = {
49
- indent: 2,
50
- jsx: true,
51
- quotes: "double",
52
- semi: true
53
- };
54
- async function stylistic(options = {}) {
55
- const {
56
- indent,
57
- jsx,
58
- overrides = {},
59
- quotes,
60
- semi
61
- } = {
62
- ...StylisticConfigDefaults,
63
- ...options
64
- };
65
- const pluginStylistic = await interop(import("@stylistic/eslint-plugin"));
66
- const config = pluginStylistic.configs.customize({
67
- flat: true,
68
- indent,
69
- jsx,
70
- pluginName: "style",
71
- quotes,
72
- semi
73
- });
74
- return [
75
- {
76
- name: "luxass:stylistic",
77
- plugins: {
78
- antfu: import_eslint_plugin_antfu.default,
79
- style: pluginStylistic
80
- },
81
- rules: {
82
- ...config.rules,
83
- "antfu/consistent-list-newline": "error",
84
- "antfu/if-newline": "off",
85
- "antfu/top-level-function": "error",
86
- "curly": ["error", "multi-line", "consistent"],
87
- "style/arrow-parens": ["error", "always", { requireForBlockBody: true }],
88
- "style/brace-style": ["error", "1tbs", { allowSingleLine: true }],
89
- ...overrides
90
- }
91
- }
92
- ];
93
- }
94
- // Annotate the CommonJS export names for ESM import in node:
95
- 0 && (module.exports = {
96
- StylisticConfigDefaults,
97
- stylistic
98
- });
@@ -1,11 +0,0 @@
1
- import '@stylistic/eslint-plugin';
2
- export { S as StylisticConfig, x as StylisticConfigDefaults, c as StylisticOptions, s as stylistic } from '../types-HqEzZfQU.cjs';
3
- import 'eslint-config-flat-gitignore';
4
- import '@antfu/eslint-define-config';
5
- import '@eslint-types/jsdoc/types';
6
- import '@eslint-types/typescript-eslint/types';
7
- import '@eslint-types/unicorn/types';
8
- import 'eslint-plugin-antfu';
9
- import 'eslint';
10
- import '@typescript-eslint/parser';
11
- import 'eslint-processor-vue-blocks';
@@ -1,11 +0,0 @@
1
- import '@stylistic/eslint-plugin';
2
- export { S as StylisticConfig, x as StylisticConfigDefaults, c as StylisticOptions, s as stylistic } from '../types-HqEzZfQU.js';
3
- import 'eslint-config-flat-gitignore';
4
- import '@antfu/eslint-define-config';
5
- import '@eslint-types/jsdoc/types';
6
- import '@eslint-types/typescript-eslint/types';
7
- import '@eslint-types/unicorn/types';
8
- import 'eslint-plugin-antfu';
9
- import 'eslint';
10
- import '@typescript-eslint/parser';
11
- import 'eslint-processor-vue-blocks';
@@ -1,9 +0,0 @@
1
- import {
2
- StylisticConfigDefaults,
3
- stylistic
4
- } from "../chunk-RDZJT36Z.mjs";
5
- import "../chunk-4YBQZLPS.mjs";
6
- export {
7
- StylisticConfigDefaults,
8
- stylistic
9
- };
@@ -1,210 +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/test.ts
31
- var test_exports = {};
32
- __export(test_exports, {
33
- test: () => test
34
- });
35
- module.exports = __toCommonJS(test_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_MARKDOWN = "**/*.md";
41
- var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
42
- var GLOB_TESTS = [
43
- `**/__tests__/**/*.${GLOB_SRC_EXT}`,
44
- `**/*.spec.${GLOB_SRC_EXT}`,
45
- `**/*.test.${GLOB_SRC_EXT}`,
46
- `**/*.bench.${GLOB_SRC_EXT}`,
47
- `**/*.benchmark.${GLOB_SRC_EXT}`
48
- ];
49
- var GLOB_NEXTJS_ROUTES = [
50
- `**/app/**/page.${GLOB_SRC_EXT}`,
51
- `**/app/**/layout.${GLOB_SRC_EXT}`,
52
- `**/app/**/error.${GLOB_SRC_EXT}`,
53
- `**/app/**/template.${GLOB_SRC_EXT}`,
54
- `**/app/**/not-found.${GLOB_SRC_EXT}`,
55
- `**/app/**/loading.${GLOB_SRC_EXT}`,
56
- `**/app/**/robots.${GLOB_SRC_EXT}`,
57
- `**/app/**/sitemap.${GLOB_SRC_EXT}`,
58
- `**/pages/**/*.${GLOB_SRC_EXT}`
59
- ];
60
-
61
- // src/utils.ts
62
- var import_node_process = __toESM(require("process"), 1);
63
- var import_local_pkg = require("local-pkg");
64
- async function interop(m) {
65
- const resolved = await m;
66
- return resolved.default || resolved;
67
- }
68
-
69
- // src/custom-rules/utils.ts
70
- var import_utils = require("@typescript-eslint/utils");
71
- var createRule = import_utils.ESLintUtils.RuleCreator((ruleName) => `https://github.com/luxass/eslint-config/blob/main/src/custom-rules/${ruleName}/README.md`);
72
-
73
- // src/custom-rules/no-only-tests/index.ts
74
- var RULE_NAME = "no-only-tests";
75
- var DEFAULT_OPTIONS = {
76
- blocks: ["describe", "it", "test"],
77
- focus: ["only"]
78
- };
79
- function getPath(node, path = []) {
80
- if (node) {
81
- const nodeName = node.name || node.property && node.property.name;
82
- if (node.object) {
83
- return getPath(
84
- node.object,
85
- [nodeName, ...path]
86
- );
87
- }
88
- if (node.callee)
89
- return getPath(node.callee, path);
90
- return [nodeName, ...path];
91
- }
92
- return path;
93
- }
94
- var noOnlyTests = createRule({
95
- name: RULE_NAME,
96
- create: (context, [options]) => {
97
- const {
98
- blocks = DEFAULT_OPTIONS.blocks,
99
- focus = DEFAULT_OPTIONS.focus
100
- } = options;
101
- return {
102
- Identifier(node) {
103
- const parent = node.parent?.object;
104
- if (!parent)
105
- return;
106
- if (!focus.includes(node.name))
107
- return;
108
- const callPath = getPath(node.parent).join(".");
109
- const found = blocks.find((block) => {
110
- if (block.endsWith("*")) {
111
- return callPath.startsWith(block.replace(/\*$/, ""));
112
- }
113
- return callPath.startsWith(`${block}.`);
114
- });
115
- if (found) {
116
- context.report({
117
- data: { block: callPath.split(".")[0], focus: node.name },
118
- messageId: "not-permitted",
119
- node
120
- });
121
- }
122
- }
123
- };
124
- },
125
- defaultOptions: [
126
- {
127
- blocks: ["describe", "it", "test"],
128
- focus: ["only"]
129
- }
130
- ],
131
- meta: {
132
- docs: {
133
- description: "disallow .only blocks in tests",
134
- recommended: "recommended"
135
- },
136
- messages: {
137
- "not-permitted": "{{ block }}.{{ focus }} not permitted"
138
- },
139
- schema: [
140
- {
141
- additionalProperties: false,
142
- properties: {
143
- blocks: {
144
- items: {
145
- type: "string"
146
- },
147
- type: "array",
148
- uniqueItems: true
149
- },
150
- focus: {
151
- items: {
152
- type: "string"
153
- },
154
- type: "array",
155
- uniqueItems: true
156
- }
157
- },
158
- type: "object"
159
- }
160
- ],
161
- type: "layout"
162
- }
163
- });
164
-
165
- // src/configs/test.ts
166
- async function test(options = {}) {
167
- const {
168
- editor = false,
169
- files = GLOB_TESTS,
170
- overrides = {}
171
- } = options;
172
- const [
173
- pluginVitest
174
- ] = await Promise.all([
175
- interop(import("eslint-plugin-vitest"))
176
- ]);
177
- return [
178
- {
179
- name: "luxass:test:setup",
180
- plugins: {
181
- test: {
182
- ...pluginVitest,
183
- rules: {
184
- ...pluginVitest.rules,
185
- "no-only-tests": noOnlyTests
186
- }
187
- }
188
- }
189
- },
190
- {
191
- name: "luxass:test:rules",
192
- files,
193
- rules: {
194
- "test/consistent-test-it": [
195
- "error",
196
- { fn: "it", withinDescribe: "it" }
197
- ],
198
- "test/no-identical-title": "error",
199
- "test/no-only-tests": editor ? "off" : "error",
200
- "test/prefer-hooks-in-order": "error",
201
- "test/prefer-lowercase-title": "error",
202
- ...overrides
203
- }
204
- }
205
- ];
206
- }
207
- // Annotate the CommonJS export names for ESM import in node:
208
- 0 && (module.exports = {
209
- test
210
- });
@@ -1,11 +0,0 @@
1
- export { e as TestOptions, d as test } 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 { e as TestOptions, d as test } 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
- test
3
- } from "../chunk-TWAETZPX.mjs";
4
- import "../chunk-4YBQZLPS.mjs";
5
- import "../chunk-KOXCJL3C.mjs";
6
- export {
7
- test
8
- };