@storm-software/eslint 0.122.8 → 0.123.0

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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-7NZUDX62.js +99 -0
  3. package/dist/{chunk-Y67QTC5U.js → chunk-K6KBWFPU.js} +1 -1
  4. package/dist/{chunk-LSG5T3ZK.js → chunk-W6QEP5VE.js} +7 -6
  5. package/dist/chunk-X3L37QNE.js +161 -0
  6. package/dist/preset.d.ts +23 -7048
  7. package/dist/preset.js +3590 -933
  8. package/dist/types-Drnq7vws.d.ts +14859 -0
  9. package/dist/utils/banner-plugin.js +3 -3
  10. package/dist/utils/combine.d.ts +14 -0
  11. package/dist/utils/combine.js +13 -0
  12. package/dist/utils/constants.d.ts +33 -22
  13. package/dist/utils/constants.js +65 -19
  14. package/dist/utils/get-file-banner.js +2 -2
  15. package/dist/utils/helpers.d.ts +55 -0
  16. package/dist/utils/helpers.js +19 -0
  17. package/dist/utils/index.d.ts +1 -1
  18. package/dist/utils/index.js +67 -21
  19. package/package.json +76 -50
  20. package/dist/chunk-723HQUNP.js +0 -14
  21. package/dist/chunk-ESFBJFNU.cjs +0 -149
  22. package/dist/chunk-GMT3V67N.cjs +0 -24
  23. package/dist/chunk-HMBBDY5L.cjs +0 -49
  24. package/dist/chunk-JS7W7LMD.cjs +0 -14
  25. package/dist/chunk-KISSHBCD.cjs +0 -1333
  26. package/dist/chunk-LFHG33FO.cjs +0 -313
  27. package/dist/chunk-QSFZU7HX.cjs +0 -47
  28. package/dist/chunk-RTM5LCEB.js +0 -149
  29. package/dist/chunk-USNT2KNT.cjs +0 -6
  30. package/dist/chunk-VIASOXKK.js +0 -1333
  31. package/dist/preset.cjs +0 -988
  32. package/dist/preset.d.cts +0 -7057
  33. package/dist/rules/import.cjs +0 -291
  34. package/dist/rules/import.d.cts +0 -5
  35. package/dist/rules/import.d.ts +0 -5
  36. package/dist/rules/import.js +0 -291
  37. package/dist/rules/jsx-a11y.cjs +0 -341
  38. package/dist/rules/jsx-a11y.d.cts +0 -5
  39. package/dist/rules/jsx-a11y.d.ts +0 -5
  40. package/dist/rules/jsx-a11y.js +0 -341
  41. package/dist/rules/react-hooks.cjs +0 -15
  42. package/dist/rules/react-hooks.d.cts +0 -5
  43. package/dist/rules/react-hooks.d.ts +0 -5
  44. package/dist/rules/react-hooks.js +0 -15
  45. package/dist/rules/react.cjs +0 -689
  46. package/dist/rules/react.d.cts +0 -5
  47. package/dist/rules/react.d.ts +0 -5
  48. package/dist/rules/react.js +0 -689
  49. package/dist/rules/storm.cjs +0 -7
  50. package/dist/rules/storm.d.cts +0 -11
  51. package/dist/rules/storm.d.ts +0 -11
  52. package/dist/rules/storm.js +0 -7
  53. package/dist/rules/ts-docs.cjs +0 -7
  54. package/dist/rules/ts-docs.d.cts +0 -5
  55. package/dist/rules/ts-docs.d.ts +0 -5
  56. package/dist/rules/ts-docs.js +0 -7
  57. package/dist/rules.d.ts +0 -7005
  58. package/dist/utils/banner-plugin.cjs +0 -9
  59. package/dist/utils/banner-plugin.d.cts +0 -6
  60. package/dist/utils/constants.cjs +0 -25
  61. package/dist/utils/constants.d.cts +0 -24
  62. package/dist/utils/create-flat-import-plugin.cjs +0 -20
  63. package/dist/utils/create-flat-import-plugin.d.cts +0 -11
  64. package/dist/utils/create-flat-import-plugin.d.ts +0 -11
  65. package/dist/utils/create-flat-import-plugin.js +0 -20
  66. package/dist/utils/format-config.cjs +0 -7
  67. package/dist/utils/format-config.d.cts +0 -5
  68. package/dist/utils/get-file-banner.cjs +0 -8
  69. package/dist/utils/get-file-banner.d.cts +0 -9
  70. package/dist/utils/ignores.cjs +0 -7
  71. package/dist/utils/ignores.d.cts +0 -3
  72. package/dist/utils/index.cjs +0 -33
  73. package/dist/utils/index.d.cts +0 -4
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.122.7-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.123.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -0,0 +1,99 @@
1
+ import {
2
+ __name
3
+ } from "./chunk-SHUYVCID.js";
4
+
5
+ // src/utils/helpers.ts
6
+ import { isPackageExists } from "local-pkg";
7
+ import process from "node:process";
8
+ import { fileURLToPath } from "node:url";
9
+ var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
10
+ var isCwdInScope = isPackageExists("@storm-stack/eslint");
11
+ var parserPlain = {
12
+ meta: {
13
+ name: "parser-plain"
14
+ },
15
+ parseForESLint: /* @__PURE__ */ __name((code) => ({
16
+ ast: {
17
+ body: [],
18
+ comments: [],
19
+ loc: {
20
+ end: code.length,
21
+ start: 0
22
+ },
23
+ range: [
24
+ 0,
25
+ code.length
26
+ ],
27
+ tokens: [],
28
+ type: "Program"
29
+ },
30
+ scopeManager: null,
31
+ services: {
32
+ isPlain: true
33
+ },
34
+ visitorKeys: {
35
+ Program: []
36
+ }
37
+ }), "parseForESLint")
38
+ };
39
+ function isInEditorEnv() {
40
+ if (process.env.CI) return false;
41
+ if (isInGitHooksOrLintStaged()) return false;
42
+ return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
43
+ }
44
+ __name(isInEditorEnv, "isInEditorEnv");
45
+ function isInGitHooksOrLintStaged() {
46
+ return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
47
+ }
48
+ __name(isInGitHooksOrLintStaged, "isInGitHooksOrLintStaged");
49
+ async function interopDefault(m) {
50
+ const resolved = await m;
51
+ return resolved.default || resolved;
52
+ }
53
+ __name(interopDefault, "interopDefault");
54
+ function isPackageInScope(name) {
55
+ return isPackageExists(name, {
56
+ paths: [
57
+ scopeUrl
58
+ ]
59
+ });
60
+ }
61
+ __name(isPackageInScope, "isPackageInScope");
62
+ async function ensurePackages(packages) {
63
+ if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
64
+ const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
65
+ if (nonExistingPackages.length === 0) return;
66
+ const p = await import("@clack/prompts");
67
+ const result = await p.confirm({
68
+ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
69
+ });
70
+ if (result) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, {
71
+ dev: true
72
+ }));
73
+ }
74
+ __name(ensurePackages, "ensurePackages");
75
+ function renameRules(rules, map) {
76
+ return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
77
+ for (const [from, to] of Object.entries(map)) {
78
+ if (key.startsWith(`${from}/`)) return [
79
+ to + key.slice(from.length),
80
+ value
81
+ ];
82
+ }
83
+ return [
84
+ key,
85
+ value
86
+ ];
87
+ }));
88
+ }
89
+ __name(renameRules, "renameRules");
90
+
91
+ export {
92
+ parserPlain,
93
+ isInEditorEnv,
94
+ isInGitHooksOrLintStaged,
95
+ interopDefault,
96
+ isPackageInScope,
97
+ ensurePackages,
98
+ renameRules
99
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ACRONYMS_LIST
3
- } from "./chunk-RTM5LCEB.js";
3
+ } from "./chunk-X3L37QNE.js";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-SHUYVCID.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getFileBanner
3
- } from "./chunk-Y67QTC5U.js";
3
+ } from "./chunk-K6KBWFPU.js";
4
4
  import {
5
- CODE_FILE
6
- } from "./chunk-RTM5LCEB.js";
5
+ GLOB_SRC
6
+ } from "./chunk-X3L37QNE.js";
7
7
  import {
8
8
  __name
9
9
  } from "./chunk-SHUYVCID.js";
@@ -20,7 +20,7 @@ function match(actual, expected) {
20
20
  }
21
21
  __name(match, "match");
22
22
  function excludeShebangs(comments) {
23
- return comments.filter(function(comment) {
23
+ return comments.filter((comment) => {
24
24
  return comment.type !== "Shebang";
25
25
  });
26
26
  }
@@ -284,7 +284,7 @@ plugin.configs && (plugin.configs.recommended = {
284
284
  banner: plugin
285
285
  },
286
286
  files: [
287
- CODE_FILE
287
+ GLOB_SRC
288
288
  ],
289
289
  ignores: [
290
290
  "!**/docs/**/*",
@@ -294,7 +294,8 @@ plugin.configs && (plugin.configs.recommended = {
294
294
  "!**/coverage/**/*",
295
295
  "!**/node_modules/**/*",
296
296
  "!**/.cache/**/*",
297
- "!**/.nx/**/*"
297
+ "!**/.nx/**/*",
298
+ "!**/.storm/**/*"
298
299
  ],
299
300
  rules: {
300
301
  "banner/banner": [
@@ -0,0 +1,161 @@
1
+ // src/utils/constants.ts
2
+ var GLOB_CODE_BLOCK = "**/*.md{,x}/*";
3
+ var GLOB_CODE_FILE = "**/*.{,c,m}{j,t}s{,x}";
4
+ var ACRONYMS_LIST = [
5
+ "API",
6
+ "ASCII",
7
+ "CPU",
8
+ "CSS",
9
+ "DNS",
10
+ "EOF",
11
+ "GUID",
12
+ "HTML",
13
+ "HTTP",
14
+ "HTTPS",
15
+ "ID",
16
+ "IP",
17
+ "JSON",
18
+ "LHS",
19
+ "OEM",
20
+ "PP",
21
+ "QA",
22
+ "RAM",
23
+ "RHS",
24
+ "RPC",
25
+ "RSS",
26
+ "SLA",
27
+ "SMTP",
28
+ "SQL",
29
+ "SSH",
30
+ "SSL",
31
+ "TCP",
32
+ "TLS",
33
+ "TTL",
34
+ "UDP",
35
+ "UI",
36
+ "UID",
37
+ "UUID",
38
+ "URI",
39
+ "URL",
40
+ "UTF",
41
+ "VM",
42
+ "XML",
43
+ "XSS"
44
+ ];
45
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
46
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
47
+ var GLOB_JS = "**/*.?([cm])js";
48
+ var GLOB_JSX = "**/*.?([cm])jsx";
49
+ var GLOB_TS = "**/*.?([cm])ts";
50
+ var GLOB_TSX = "**/*.?([cm])tsx";
51
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
52
+ var GLOB_CSS = "**/*.css";
53
+ var GLOB_POSTCSS = "**/*.{p,post}css";
54
+ var GLOB_LESS = "**/*.less";
55
+ var GLOB_SCSS = "**/*.scss";
56
+ var GLOB_JSON = "**/*.json";
57
+ var GLOB_JSON5 = "**/*.json5";
58
+ var GLOB_JSONC = "**/*.jsonc";
59
+ var GLOB_MARKDOWN = "**/*.md";
60
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
61
+ var GLOB_SVELTE = "**/*.svelte";
62
+ var GLOB_VUE = "**/*.vue";
63
+ var GLOB_YAML = "**/*.y?(a)ml";
64
+ var GLOB_TOML = "**/*.toml";
65
+ var GLOB_XML = "**/*.xml";
66
+ var GLOB_SVG = "**/*.svg";
67
+ var GLOB_HTML = "**/*.htm?(l)";
68
+ var GLOB_ASTRO = "**/*.astro";
69
+ var GLOB_ASTRO_TS = "**/*.astro/*.ts";
70
+ var GLOB_GRAPHQL = "**/*.{g,graph}ql";
71
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
72
+ var GLOB_TESTS = [
73
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
74
+ `**/*.spec.${GLOB_SRC_EXT}`,
75
+ `**/*.test.${GLOB_SRC_EXT}`,
76
+ `**/*.bench.${GLOB_SRC_EXT}`,
77
+ `**/*.benchmark.${GLOB_SRC_EXT}`
78
+ ];
79
+ var GLOB_ALL_SRC = [
80
+ GLOB_SRC,
81
+ GLOB_STYLE,
82
+ GLOB_JSON,
83
+ GLOB_JSON5,
84
+ GLOB_MARKDOWN,
85
+ GLOB_SVELTE,
86
+ GLOB_VUE,
87
+ GLOB_YAML,
88
+ GLOB_XML,
89
+ GLOB_HTML
90
+ ];
91
+ var GLOB_EXCLUDE = [
92
+ "**/node_modules",
93
+ "**/dist",
94
+ "**/package-lock.json",
95
+ "**/yarn.lock",
96
+ "**/pnpm-lock.yaml",
97
+ "**/bun.lockb",
98
+ "**/.nx",
99
+ "**/.storm",
100
+ "**/output",
101
+ "**/coverage",
102
+ "**/temp",
103
+ "**/.temp",
104
+ "**/tmp",
105
+ "**/.tmp",
106
+ "**/.history",
107
+ "**/.vitepress/cache",
108
+ "**/.nuxt",
109
+ "**/.next",
110
+ "**/.svelte-kit",
111
+ "**/.vercel",
112
+ "**/.changeset",
113
+ "**/.idea",
114
+ "**/.cache",
115
+ "**/.output",
116
+ "**/.vite-inspect",
117
+ "**/.yarn",
118
+ "**/vite.config.*.timestamp-*",
119
+ "**/CHANGELOG*.md",
120
+ "**/*.min.*",
121
+ "**/LICENSE*",
122
+ "**/__snapshots__",
123
+ "**/auto-import?(s).d.ts",
124
+ "**/components.d.ts"
125
+ ];
126
+
127
+ export {
128
+ GLOB_CODE_BLOCK,
129
+ GLOB_CODE_FILE,
130
+ ACRONYMS_LIST,
131
+ GLOB_SRC_EXT,
132
+ GLOB_SRC,
133
+ GLOB_JS,
134
+ GLOB_JSX,
135
+ GLOB_TS,
136
+ GLOB_TSX,
137
+ GLOB_STYLE,
138
+ GLOB_CSS,
139
+ GLOB_POSTCSS,
140
+ GLOB_LESS,
141
+ GLOB_SCSS,
142
+ GLOB_JSON,
143
+ GLOB_JSON5,
144
+ GLOB_JSONC,
145
+ GLOB_MARKDOWN,
146
+ GLOB_MARKDOWN_IN_MARKDOWN,
147
+ GLOB_SVELTE,
148
+ GLOB_VUE,
149
+ GLOB_YAML,
150
+ GLOB_TOML,
151
+ GLOB_XML,
152
+ GLOB_SVG,
153
+ GLOB_HTML,
154
+ GLOB_ASTRO,
155
+ GLOB_ASTRO_TS,
156
+ GLOB_GRAPHQL,
157
+ GLOB_MARKDOWN_CODE,
158
+ GLOB_TESTS,
159
+ GLOB_ALL_SRC,
160
+ GLOB_EXCLUDE
161
+ };