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