@storm-software/eslint 0.126.2 → 0.127.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.
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.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)
24
+ [![Version](https://img.shields.io/badge/version-0.126.2-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,245 @@
1
+ import {
2
+ __name
3
+ } from "./chunk-SHUYVCID.js";
4
+
5
+ // src/utils/correct-paths.ts
6
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
7
+ function normalizeWindowsPath(input = "") {
8
+ if (!input) {
9
+ return input;
10
+ }
11
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
12
+ }
13
+ __name(normalizeWindowsPath, "normalizeWindowsPath");
14
+ var _UNC_REGEX = /^[/\\]{2}/;
15
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
16
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
17
+ var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
18
+ var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
19
+ var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
20
+ var sep = "/";
21
+ var correctPaths = /* @__PURE__ */ __name(function(path) {
22
+ if (!path || path.length === 0) {
23
+ return ".";
24
+ }
25
+ path = normalizeWindowsPath(path);
26
+ const isUNCPath = path.match(_UNC_REGEX);
27
+ const isPathAbsolute = isAbsolute(path);
28
+ const trailingSeparator = path[path.length - 1] === "/";
29
+ path = normalizeString(path, !isPathAbsolute);
30
+ if (path.length === 0) {
31
+ if (isPathAbsolute) {
32
+ return "/";
33
+ }
34
+ return trailingSeparator ? "./" : ".";
35
+ }
36
+ if (trailingSeparator) {
37
+ path += "/";
38
+ }
39
+ if (_DRIVE_LETTER_RE.test(path)) {
40
+ path += "/";
41
+ }
42
+ if (isUNCPath) {
43
+ if (!isPathAbsolute) {
44
+ return `//./${path}`;
45
+ }
46
+ return `//${path}`;
47
+ }
48
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
49
+ }, "correctPaths");
50
+ var joinPaths = /* @__PURE__ */ __name(function(...segments) {
51
+ let path = "";
52
+ for (const seg of segments) {
53
+ if (!seg) {
54
+ continue;
55
+ }
56
+ if (path.length > 0) {
57
+ const pathTrailing = path[path.length - 1] === "/";
58
+ const segLeading = seg[0] === "/";
59
+ const both = pathTrailing && segLeading;
60
+ if (both) {
61
+ path += seg.slice(1);
62
+ } else {
63
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
64
+ }
65
+ } else {
66
+ path += seg;
67
+ }
68
+ }
69
+ return correctPaths(path);
70
+ }, "joinPaths");
71
+ function cwd() {
72
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
73
+ return process.cwd().replace(/\\/g, "/");
74
+ }
75
+ return "/";
76
+ }
77
+ __name(cwd, "cwd");
78
+ var resolve = /* @__PURE__ */ __name(function(...arguments_) {
79
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
80
+ let resolvedPath = "";
81
+ let resolvedAbsolute = false;
82
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
83
+ const path = index >= 0 ? arguments_[index] : cwd();
84
+ if (!path || path.length === 0) {
85
+ continue;
86
+ }
87
+ resolvedPath = `${path}/${resolvedPath}`;
88
+ resolvedAbsolute = isAbsolute(path);
89
+ }
90
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
91
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
92
+ return `/${resolvedPath}`;
93
+ }
94
+ return resolvedPath.length > 0 ? resolvedPath : ".";
95
+ }, "resolve");
96
+ function normalizeString(path, allowAboveRoot) {
97
+ let res = "";
98
+ let lastSegmentLength = 0;
99
+ let lastSlash = -1;
100
+ let dots = 0;
101
+ let char = null;
102
+ for (let index = 0; index <= path.length; ++index) {
103
+ if (index < path.length) {
104
+ char = path[index];
105
+ } else if (char === "/") {
106
+ break;
107
+ } else {
108
+ char = "/";
109
+ }
110
+ if (char === "/") {
111
+ if (lastSlash === index - 1 || dots === 1) {
112
+ } else if (dots === 2) {
113
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
114
+ if (res.length > 2) {
115
+ const lastSlashIndex = res.lastIndexOf("/");
116
+ if (lastSlashIndex === -1) {
117
+ res = "";
118
+ lastSegmentLength = 0;
119
+ } else {
120
+ res = res.slice(0, lastSlashIndex);
121
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
122
+ }
123
+ lastSlash = index;
124
+ dots = 0;
125
+ continue;
126
+ } else if (res.length > 0) {
127
+ res = "";
128
+ lastSegmentLength = 0;
129
+ lastSlash = index;
130
+ dots = 0;
131
+ continue;
132
+ }
133
+ }
134
+ if (allowAboveRoot) {
135
+ res += res.length > 0 ? "/.." : "..";
136
+ lastSegmentLength = 2;
137
+ }
138
+ } else {
139
+ if (res.length > 0) {
140
+ res += `/${path.slice(lastSlash + 1, index)}`;
141
+ } else {
142
+ res = path.slice(lastSlash + 1, index);
143
+ }
144
+ lastSegmentLength = index - lastSlash - 1;
145
+ }
146
+ lastSlash = index;
147
+ dots = 0;
148
+ } else if (char === "." && dots !== -1) {
149
+ ++dots;
150
+ } else {
151
+ dots = -1;
152
+ }
153
+ }
154
+ return res;
155
+ }
156
+ __name(normalizeString, "normalizeString");
157
+ var isAbsolute = /* @__PURE__ */ __name(function(p) {
158
+ return _IS_ABSOLUTE_RE.test(p);
159
+ }, "isAbsolute");
160
+ var toNamespacedPath = /* @__PURE__ */ __name(function(p) {
161
+ return normalizeWindowsPath(p);
162
+ }, "toNamespacedPath");
163
+ var extname = /* @__PURE__ */ __name(function(p) {
164
+ if (p === "..") return "";
165
+ const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
166
+ return match && match[1] || "";
167
+ }, "extname");
168
+ var relative = /* @__PURE__ */ __name(function(from, to) {
169
+ const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
170
+ const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
171
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
172
+ return _to.join("/");
173
+ }
174
+ const _fromCopy = [
175
+ ..._from
176
+ ];
177
+ for (const segment of _fromCopy) {
178
+ if (_to[0] !== segment) {
179
+ break;
180
+ }
181
+ _from.shift();
182
+ _to.shift();
183
+ }
184
+ return [
185
+ ..._from.map(() => ".."),
186
+ ..._to
187
+ ].join("/");
188
+ }, "relative");
189
+ var dirname = /* @__PURE__ */ __name(function(p) {
190
+ const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
191
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
192
+ segments[0] += "/";
193
+ }
194
+ return segments.join("/") || (isAbsolute(p) ? "/" : ".");
195
+ }, "dirname");
196
+ var format = /* @__PURE__ */ __name(function(p) {
197
+ const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
198
+ const segments = [
199
+ p.root,
200
+ p.dir,
201
+ p.base ?? (p.name ?? "") + ext
202
+ ].filter(Boolean);
203
+ return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
204
+ }, "format");
205
+ var basename = /* @__PURE__ */ __name(function(p, extension) {
206
+ const segments = normalizeWindowsPath(p).split("/");
207
+ let lastSegment = "";
208
+ for (let i = segments.length - 1; i >= 0; i--) {
209
+ const val = segments[i];
210
+ if (val) {
211
+ lastSegment = val;
212
+ break;
213
+ }
214
+ }
215
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
216
+ }, "basename");
217
+ var parse = /* @__PURE__ */ __name(function(p) {
218
+ const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
219
+ const base = basename(p);
220
+ const extension = extname(base);
221
+ return {
222
+ root,
223
+ dir: dirname(p),
224
+ base,
225
+ ext: extension,
226
+ name: base.slice(0, base.length - extension.length)
227
+ };
228
+ }, "parse");
229
+
230
+ export {
231
+ normalizeWindowsPath,
232
+ sep,
233
+ correctPaths,
234
+ joinPaths,
235
+ resolve,
236
+ normalizeString,
237
+ isAbsolute,
238
+ toNamespacedPath,
239
+ extname,
240
+ relative,
241
+ dirname,
242
+ format,
243
+ basename,
244
+ parse
245
+ };
package/dist/preset.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Linter } from 'eslint';
2
2
  import { FlatConfigComposer } from 'eslint-flat-config-utils';
3
- import { O as OptionsConfig, R as RuleOptions, T as TypedFlatConfigItem, A as Awaitable, C as ConfigNames } from './types-CnDDaY3J.js';
3
+ import { O as OptionsConfig, R as RuleOptions, T as TypedFlatConfigItem, A as Awaitable, C as ConfigNames } from './types-CIpgkHRj.js';
4
4
  import '@nx/eslint-plugin/src/utils/runtime-lint-utils';
5
5
  import '@stylistic/eslint-plugin';
6
6
  import '@typescript-eslint/parser';