@storm-software/eslint 0.170.156 → 0.170.157

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 (92) hide show
  1. package/README.md +1 -1
  2. package/dist/astro-CKzo6xci.d.mts +5 -0
  3. package/dist/banner-YnHf4ewf.d.mts +5 -0
  4. package/dist/bun-OJPLvfnX.d.mts +5 -0
  5. package/dist/cspell-CfGd6g7m.d.mts +8 -0
  6. package/dist/disables-Dx5b56Fi.d.mts +5 -0
  7. package/dist/find-workspace-root-D3UHWbgn.mjs +211 -0
  8. package/dist/formatters-VU6Zu_ju.d.mts +5 -0
  9. package/dist/graphql-ClFinA5J.d.mts +5 -0
  10. package/dist/helpers-mce_MNwt.mjs +72 -0
  11. package/dist/ignores-CPeru9Fz.d.mts +5 -0
  12. package/dist/imports-CQToT7JW.d.mts +5 -0
  13. package/dist/index.d.mts +41 -0
  14. package/dist/index.mjs +42 -0
  15. package/dist/javascript-BR8uv0Wr.d.mts +5 -0
  16. package/dist/jsdoc-Dy8bHykP.d.mts +5 -0
  17. package/dist/jsonc-YqDXTIOi.d.mts +5 -0
  18. package/dist/jsx-DzqEJSYd.d.mts +5 -0
  19. package/dist/markdown-C5lFEI83.d.mts +5 -0
  20. package/dist/mdx-CDEhveb1.d.mts +5 -0
  21. package/dist/next-DGhspeMc.d.mts +8 -0
  22. package/dist/node-CQgsZ8nv.d.mts +5 -0
  23. package/dist/nx-CLRc6QRM.d.mts +8 -0
  24. package/dist/perfectionist-CgSgqAjV.d.mts +10 -0
  25. package/dist/plugins-CZWNS7l4.mjs +8291 -0
  26. package/dist/plugins.d.mts +616 -0
  27. package/dist/plugins.mjs +2 -0
  28. package/dist/pnpm-Cp9VzsCv.d.mts +5 -0
  29. package/dist/preset-x6MId9-7.mjs +265 -0
  30. package/dist/preset.d.mts +30 -0
  31. package/dist/preset.mjs +3 -0
  32. package/dist/prettier-CboafVRp.d.mts +8 -0
  33. package/dist/react-C5HWHYPh.d.mts +5 -0
  34. package/dist/react-native-DjQo3PXB.d.mts +8 -0
  35. package/dist/regexp-D2Fm6vg7.d.mts +5 -0
  36. package/dist/rolldown-runtime-CMFfr-1z.mjs +26 -0
  37. package/dist/secrets-DfvPNLCF.d.mts +10 -0
  38. package/dist/sort-9_xeGmal.d.mts +16 -0
  39. package/dist/storybook-DqDJ5exI.d.mts +5 -0
  40. package/dist/stylistic-9jDGqsHH.d.mts +9 -0
  41. package/dist/test-Dw-h86ig.d.mts +5 -0
  42. package/dist/toml-ConAZLXy.d.mts +5 -0
  43. package/dist/tsdoc-DcYWMVl0.d.mts +5 -0
  44. package/dist/{types.d.cts → typegen.d.mts} +8536 -11156
  45. package/dist/types-XIthLTox.d.mts +852 -0
  46. package/dist/types.d.mts +3 -0
  47. package/dist/types.mjs +2 -0
  48. package/dist/typescript-BFiiMXDt.d.mts +5 -0
  49. package/dist/unicorn-CQ3PTdfT.d.mts +5 -0
  50. package/dist/unocss-Uw-vEvNU.d.mts +5 -0
  51. package/dist/yaml-Ddbh49WY.d.mts +5 -0
  52. package/dist/zod-7F7dUsU5.d.mts +8 -0
  53. package/package.json +58 -79
  54. package/dist/index.cjs +0 -24
  55. package/dist/index.d.cts +0 -127
  56. package/dist/index.d.ts +0 -127
  57. package/dist/index.js +0 -7
  58. package/dist/preset.cjs +0 -354
  59. package/dist/preset.d.cts +0 -34
  60. package/dist/preset.d.ts +0 -34
  61. package/dist/preset.js +0 -344
  62. package/dist/types.cjs +0 -12
  63. package/dist/types.d.ts +0 -19537
  64. package/dist/types.js +0 -1
  65. package/dist/utils/combine.cjs +0 -8
  66. package/dist/utils/combine.d.cts +0 -14
  67. package/dist/utils/combine.d.ts +0 -14
  68. package/dist/utils/combine.js +0 -6
  69. package/dist/utils/correct-paths.cjs +0 -231
  70. package/dist/utils/correct-paths.d.cts +0 -30
  71. package/dist/utils/correct-paths.d.ts +0 -30
  72. package/dist/utils/correct-paths.js +0 -216
  73. package/dist/utils/find-workspace-root.cjs +0 -96
  74. package/dist/utils/find-workspace-root.d.cts +0 -16
  75. package/dist/utils/find-workspace-root.d.ts +0 -16
  76. package/dist/utils/find-workspace-root.js +0 -93
  77. package/dist/utils/format-config.cjs +0 -19
  78. package/dist/utils/format-config.d.cts +0 -5
  79. package/dist/utils/format-config.d.ts +0 -5
  80. package/dist/utils/format-config.js +0 -17
  81. package/dist/utils/helpers.cjs +0 -86
  82. package/dist/utils/helpers.d.cts +0 -55
  83. package/dist/utils/helpers.d.ts +0 -55
  84. package/dist/utils/helpers.js +0 -72
  85. package/dist/utils/package-manager.cjs +0 -18
  86. package/dist/utils/package-manager.d.cts +0 -8
  87. package/dist/utils/package-manager.d.ts +0 -8
  88. package/dist/utils/package-manager.js +0 -16
  89. package/dist/utils/tsconfig.cjs +0 -43
  90. package/dist/utils/tsconfig.d.cts +0 -25
  91. package/dist/utils/tsconfig.d.ts +0 -25
  92. package/dist/utils/tsconfig.js +0 -40
package/dist/preset.js DELETED
@@ -1,344 +0,0 @@
1
- import { FlatConfigComposer } from 'eslint-flat-config-utils';
2
- import { isPackageExists } from 'local-pkg';
3
- import { ignores, javascript, node, imports, nx, perfectionist, secrets, typescript, banner, prettier, cspell, unicorn, jsdoc, tsdoc, jsx, zod, stylistic, regexp, test, graphql, react, reactNative, next, storybook, unocss, astro, pnpm, jsonc, sortTsconfig, sortPackageJson, yaml, toml, markdown, mdx, formatters, disables } from './configs';
4
- import { isInEditorEnv, interopDefault } from './utils/helpers';
5
- import { getTsConfigPath } from './utils/tsconfig';
6
- import { detectPackageManager } from './utils/package-manager';
7
- import { bun } from './configs/bun';
8
-
9
- const flatConfigProps = [
10
- "name",
11
- "languageOptions",
12
- "linterOptions",
13
- "processor",
14
- "plugins",
15
- "rules",
16
- "settings"
17
- ];
18
- const defaultPluginRenaming = {
19
- "@eslint-react": "react",
20
- "@eslint-react/dom": "react-dom",
21
- "@eslint-react/hooks-extra": "react-hooks-extra",
22
- "@eslint-react/naming-convention": "react-naming-convention",
23
- "@stylistic": "style",
24
- "@typescript-eslint": "ts",
25
- "import-x": "import",
26
- n: "node",
27
- vitest: "test",
28
- yml: "yaml"
29
- };
30
- function resolveSubOptions(options, key) {
31
- return typeof options[key] === "boolean" ? {} : options[key] || {};
32
- }
33
- function getOverrides(options, key) {
34
- const sub = resolveSubOptions(options, key);
35
- return "overrides" in sub ? sub.overrides : {};
36
- }
37
- function preset(options, ...userConfigs) {
38
- const {
39
- name,
40
- globals = {},
41
- banner: enableBanner = true,
42
- astro: enableAstro = false,
43
- autoRenamePlugins = true,
44
- componentExts = [],
45
- gitignore: enableGitignore = true,
46
- jsx: enableJsx = true,
47
- mdx: enableMdx = false,
48
- cspell: enableCSpell = true,
49
- react: enableReact = false,
50
- "react-native": enableReactNative = false,
51
- regexp: enableRegexp = true,
52
- next: enableNext = false,
53
- graphql: enableGraphQL = false,
54
- storybook: enableStorybook = false,
55
- typescript: enableTypeScript = isPackageExists("typescript"),
56
- unicorn: enableUnicorn = true,
57
- jsdoc: enableJSDoc = false,
58
- tsdoc: enableTSDoc = true,
59
- test: enableTest = true,
60
- unocss: enableUnoCSS = false,
61
- zod: enableZod = false,
62
- bun: enableBun,
63
- pnpm: enablePnpm
64
- } = options;
65
- const packageManager = detectPackageManager();
66
- let isInEditor = options.isInEditor;
67
- if (!isInEditor) {
68
- isInEditor = isInEditorEnv();
69
- if (isInEditor) {
70
- console.log(
71
- "[@storm-software/eslint] Detected running in editor, some rules are disabled."
72
- );
73
- }
74
- }
75
- const stylisticOptions = !options.stylistic ? false : typeof options.stylistic === "object" ? options.stylistic : {};
76
- if (stylisticOptions && !("jsx" in stylisticOptions)) {
77
- stylisticOptions.jsx = enableJsx;
78
- }
79
- const configs = [];
80
- if (enableGitignore) {
81
- if (typeof enableGitignore !== "boolean") {
82
- configs.push(
83
- interopDefault(import('eslint-config-flat-gitignore')).then((r) => [
84
- r({
85
- name: "storm/gitignore",
86
- ...enableGitignore
87
- })
88
- ])
89
- );
90
- } else {
91
- configs.push(
92
- interopDefault(import('eslint-config-flat-gitignore')).then((r) => [
93
- r({
94
- name: "storm/gitignore",
95
- strict: false
96
- })
97
- ])
98
- );
99
- }
100
- }
101
- configs.push(
102
- ignores(options.ignores),
103
- javascript({
104
- globals,
105
- isInEditor,
106
- overrides: getOverrides(options, "javascript")
107
- }),
108
- node(),
109
- imports({
110
- stylistic: stylisticOptions
111
- }),
112
- nx(resolveSubOptions(options, "nx")),
113
- perfectionist(),
114
- secrets({ json: options.jsonc !== false })
115
- );
116
- let typescriptOptions = {};
117
- if (enableTypeScript) {
118
- typescriptOptions = resolveSubOptions(options, "typescript");
119
- if (typescriptOptions.tsconfigPath !== false) {
120
- typescriptOptions.tsconfigPath = getTsConfigPath(
121
- typescriptOptions.tsconfigPath,
122
- options.type
123
- );
124
- }
125
- }
126
- if (enableTypeScript) {
127
- configs.push(
128
- typescript({
129
- ...typescriptOptions,
130
- tsconfigPath: typescriptOptions.tsconfigPath === false ? void 0 : typescriptOptions.tsconfigPath,
131
- componentExts,
132
- overrides: getOverrides(options, "typescript"),
133
- type: options.type
134
- })
135
- );
136
- }
137
- if (enableBanner) {
138
- configs.push(
139
- banner({
140
- ...resolveSubOptions(options, "banner"),
141
- name,
142
- overrides: getOverrides(options, "banner")
143
- })
144
- );
145
- }
146
- if (!stylisticOptions) {
147
- configs.push(prettier());
148
- }
149
- if (enableCSpell) {
150
- configs.push(cspell(resolveSubOptions(options, "cspell")));
151
- }
152
- if (enableUnicorn) {
153
- configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
154
- }
155
- if (enableJSDoc) {
156
- configs.push(
157
- jsdoc({
158
- ...resolveSubOptions(options, "jsdoc"),
159
- overrides: getOverrides(options, "jsdoc")
160
- })
161
- );
162
- }
163
- if (enableTSDoc) {
164
- configs.push(
165
- tsdoc({
166
- ...resolveSubOptions(options, "tsdoc"),
167
- overrides: getOverrides(options, "tsdoc")
168
- })
169
- );
170
- }
171
- if (enableJsx) {
172
- configs.push(jsx());
173
- }
174
- if (enableZod) {
175
- configs.push(
176
- zod({
177
- overrides: getOverrides(options, "zod")
178
- })
179
- );
180
- }
181
- if (stylisticOptions) {
182
- configs.push(
183
- stylistic({
184
- ...stylisticOptions,
185
- lineEndings: stylisticOptions.lineEndings ?? "unix",
186
- lessOpinionated: options.lessOpinionated,
187
- overrides: getOverrides(options, "stylistic")
188
- })
189
- );
190
- }
191
- if (enableRegexp) {
192
- configs.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
193
- }
194
- if (enableTest) {
195
- configs.push(
196
- test({
197
- isInEditor,
198
- overrides: getOverrides(options, "test")
199
- })
200
- );
201
- }
202
- if (enableGraphQL) {
203
- configs.push(graphql(resolveSubOptions(options, "graphql")));
204
- }
205
- if (enableReact) {
206
- configs.push(
207
- react({
208
- ...typescriptOptions,
209
- tsconfigPath: typescriptOptions.tsconfigPath === false ? void 0 : typescriptOptions.tsconfigPath,
210
- ...typeof enableReact === "boolean" ? { strict: false } : enableReact,
211
- overrides: getOverrides(options, "react")
212
- })
213
- );
214
- }
215
- if (enableReactNative) {
216
- configs.push(
217
- reactNative({
218
- ...resolveSubOptions(options, "react-native"),
219
- overrides: getOverrides(options, "react-native")
220
- })
221
- );
222
- }
223
- if (enableNext) {
224
- configs.push(next(resolveSubOptions(options, "next")));
225
- }
226
- if (enableStorybook) {
227
- configs.push(storybook(resolveSubOptions(options, "storybook")));
228
- }
229
- if (enableUnoCSS) {
230
- configs.push(
231
- unocss({
232
- ...resolveSubOptions(options, "unocss"),
233
- overrides: getOverrides(options, "unocss")
234
- })
235
- );
236
- }
237
- if (enableAstro) {
238
- configs.push(
239
- astro({
240
- overrides: getOverrides(options, "astro"),
241
- stylistic: stylisticOptions
242
- })
243
- );
244
- }
245
- if (enablePnpm ?? packageManager !== "bun") {
246
- configs.push(
247
- pnpm({
248
- overrides: getOverrides(options, "pnpm"),
249
- ignore: typeof enablePnpm !== "boolean" ? enablePnpm?.ignore : void 0
250
- })
251
- );
252
- }
253
- if (enableBun ?? packageManager === "bun") {
254
- configs.push(bun({
255
- overrides: getOverrides(options, "bun"),
256
- ignore: typeof enableBun !== "boolean" ? enableBun?.ignore : void 0
257
- }));
258
- }
259
- if (options.jsonc ?? true) {
260
- configs.push(
261
- jsonc({
262
- overrides: getOverrides(options, "jsonc"),
263
- stylistic: stylisticOptions
264
- }),
265
- sortTsconfig()
266
- );
267
- if (stylisticOptions) {
268
- configs.push(sortPackageJson());
269
- }
270
- }
271
- if (options.yaml ?? true) {
272
- configs.push(
273
- yaml({
274
- overrides: getOverrides(options, "yaml"),
275
- stylistic: stylisticOptions
276
- })
277
- );
278
- }
279
- if (options.toml ?? true) {
280
- configs.push(
281
- toml({
282
- overrides: getOverrides(options, "toml"),
283
- stylistic: stylisticOptions
284
- })
285
- );
286
- }
287
- if (options.markdown === true) {
288
- configs.push(
289
- markdown({
290
- componentExts,
291
- overrides: getOverrides(options, "markdown")
292
- })
293
- );
294
- }
295
- if (enableMdx) {
296
- configs.push(
297
- mdx({
298
- overrides: getOverrides(options, "mdx")
299
- })
300
- );
301
- }
302
- if (options.formatters) {
303
- configs.push(
304
- formatters(
305
- options.formatters,
306
- typeof stylisticOptions === "boolean" ? {} : stylisticOptions
307
- )
308
- );
309
- }
310
- configs.push(disables());
311
- if ("files" in options) {
312
- throw new Error(
313
- '[@storm-software/eslint] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.'
314
- );
315
- }
316
- const fusedConfig = flatConfigProps.reduce((acc, key) => {
317
- if (key in options) {
318
- acc[key] = options[key];
319
- }
320
- return acc;
321
- }, {});
322
- if (Object.keys(fusedConfig).length) configs.push([fusedConfig]);
323
- let composer = new FlatConfigComposer();
324
- composer = composer.append(
325
- ...configs,
326
- ...userConfigs
327
- );
328
- if (autoRenamePlugins) {
329
- composer = composer.renamePlugins(defaultPluginRenaming);
330
- }
331
- if (isInEditor) {
332
- composer = composer.disableRulesFix(["test/no-only-tests"], {
333
- builtinRules: () => import(["eslint", "use-at-your-own-risk"].join("/")).then(
334
- (r) => r.builtinRules
335
- )
336
- });
337
- }
338
- return composer;
339
- }
340
- const getConfig = preset;
341
- const defineConfig = preset;
342
- var preset_default = preset;
343
-
344
- export { preset_default as default, defaultPluginRenaming, defineConfig, getConfig, getOverrides, preset, resolveSubOptions };
package/dist/types.cjs DELETED
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var typegen_d = require('./typegen.d');
4
-
5
-
6
-
7
- Object.keys(typegen_d).forEach(function (k) {
8
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
- enumerable: true,
10
- get: function () { return typegen_d[k]; }
11
- });
12
- });