@storm-software/linting-tools 1.107.2 → 1.107.4
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 +1 -1
- package/bin/lint.cjs +16 -10
- package/bin/lint.js +19 -13
- package/dist/index.cjs +11 -5
- package/dist/index.js +19 -13
- package/package.json +1 -2
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
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/bin/lint.cjs
CHANGED
|
@@ -225,38 +225,44 @@ var COLOR_KEYS = [
|
|
|
225
225
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
226
226
|
var import_node_fs2 = require("fs");
|
|
227
227
|
var import_promises = require("fs/promises");
|
|
228
|
-
var
|
|
228
|
+
var import_node_path3 = require("path");
|
|
229
229
|
|
|
230
230
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
231
|
-
var
|
|
231
|
+
var import_node_path = require("path");
|
|
232
|
+
var removeWindowsDriveLetter = /* @__PURE__ */ __name((osSpecificPath) => {
|
|
233
|
+
return osSpecificPath.replace(/^[A-Z]:/, "");
|
|
234
|
+
}, "removeWindowsDriveLetter");
|
|
232
235
|
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
233
236
|
if (!path) {
|
|
234
237
|
return "";
|
|
235
238
|
}
|
|
236
|
-
if (
|
|
237
|
-
path
|
|
239
|
+
if (path.includes("\\")) {
|
|
240
|
+
if (!path.toUpperCase().startsWith("C:")) {
|
|
241
|
+
path = `C:${path}`;
|
|
242
|
+
}
|
|
243
|
+
return path.replaceAll("/", "\\");
|
|
238
244
|
}
|
|
239
|
-
return path.
|
|
245
|
+
return removeWindowsDriveLetter(path).split("\\").join("/");
|
|
240
246
|
}, "correctPaths");
|
|
241
247
|
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
242
248
|
if (!paths || paths.length === 0) {
|
|
243
249
|
return "";
|
|
244
250
|
}
|
|
245
|
-
return correctPaths((0,
|
|
251
|
+
return correctPaths((0, import_node_path.join)(...paths));
|
|
246
252
|
}, "joinPaths");
|
|
247
253
|
|
|
248
254
|
// ../config-tools/src/utilities/find-up.ts
|
|
249
255
|
var import_node_fs = require("fs");
|
|
250
|
-
var
|
|
256
|
+
var import_node_path2 = require("path");
|
|
251
257
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
252
258
|
var depth = 0;
|
|
253
259
|
function findFolderUp(startPath, endFileNames) {
|
|
254
260
|
const _startPath = startPath ?? process.cwd();
|
|
255
|
-
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0,
|
|
261
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path2.join)(_startPath, endFileName)))) {
|
|
256
262
|
return _startPath;
|
|
257
263
|
}
|
|
258
264
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
259
|
-
const parent = (0,
|
|
265
|
+
const parent = (0, import_node_path2.join)(_startPath, "..");
|
|
260
266
|
return findFolderUp(parent, endFileNames);
|
|
261
267
|
}
|
|
262
268
|
return void 0;
|
|
@@ -353,7 +359,7 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
353
359
|
let namespace = void 0;
|
|
354
360
|
let repository = void 0;
|
|
355
361
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
356
|
-
if ((0, import_node_fs2.existsSync)((0,
|
|
362
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path3.join)(workspaceRoot, "package.json"))) {
|
|
357
363
|
const file = await (0, import_promises.readFile)(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
358
364
|
if (file) {
|
|
359
365
|
const packageJson = JSON.parse(file);
|
package/bin/lint.js
CHANGED
|
@@ -204,38 +204,44 @@ var COLOR_KEYS = [
|
|
|
204
204
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
205
205
|
import { existsSync as existsSync2 } from "node:fs";
|
|
206
206
|
import { readFile } from "node:fs/promises";
|
|
207
|
-
import { join as
|
|
207
|
+
import { join as join3 } from "node:path";
|
|
208
208
|
|
|
209
209
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
210
|
-
import {
|
|
210
|
+
import { join } from "node:path";
|
|
211
|
+
var removeWindowsDriveLetter = /* @__PURE__ */ __name((osSpecificPath) => {
|
|
212
|
+
return osSpecificPath.replace(/^[A-Z]:/, "");
|
|
213
|
+
}, "removeWindowsDriveLetter");
|
|
211
214
|
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
212
215
|
if (!path) {
|
|
213
216
|
return "";
|
|
214
217
|
}
|
|
215
|
-
if (
|
|
216
|
-
path
|
|
218
|
+
if (path.includes("\\")) {
|
|
219
|
+
if (!path.toUpperCase().startsWith("C:")) {
|
|
220
|
+
path = `C:${path}`;
|
|
221
|
+
}
|
|
222
|
+
return path.replaceAll("/", "\\");
|
|
217
223
|
}
|
|
218
|
-
return path.
|
|
224
|
+
return removeWindowsDriveLetter(path).split("\\").join("/");
|
|
219
225
|
}, "correctPaths");
|
|
220
226
|
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
221
227
|
if (!paths || paths.length === 0) {
|
|
222
228
|
return "";
|
|
223
229
|
}
|
|
224
|
-
return correctPaths(
|
|
230
|
+
return correctPaths(join(...paths));
|
|
225
231
|
}, "joinPaths");
|
|
226
232
|
|
|
227
233
|
// ../config-tools/src/utilities/find-up.ts
|
|
228
234
|
import { existsSync } from "node:fs";
|
|
229
|
-
import { join } from "node:path";
|
|
235
|
+
import { join as join2 } from "node:path";
|
|
230
236
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
231
237
|
var depth = 0;
|
|
232
238
|
function findFolderUp(startPath, endFileNames) {
|
|
233
239
|
const _startPath = startPath ?? process.cwd();
|
|
234
|
-
if (endFileNames.some((endFileName) => existsSync(
|
|
240
|
+
if (endFileNames.some((endFileName) => existsSync(join2(_startPath, endFileName)))) {
|
|
235
241
|
return _startPath;
|
|
236
242
|
}
|
|
237
243
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
238
|
-
const parent =
|
|
244
|
+
const parent = join2(_startPath, "..");
|
|
239
245
|
return findFolderUp(parent, endFileNames);
|
|
240
246
|
}
|
|
241
247
|
return void 0;
|
|
@@ -332,7 +338,7 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
332
338
|
let namespace = void 0;
|
|
333
339
|
let repository = void 0;
|
|
334
340
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
335
|
-
if (existsSync2(
|
|
341
|
+
if (existsSync2(join3(workspaceRoot, "package.json"))) {
|
|
336
342
|
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
337
343
|
if (file) {
|
|
338
344
|
const packageJson = JSON.parse(file);
|
|
@@ -1228,13 +1234,13 @@ var transform = /* @__PURE__ */ __name((options) => {
|
|
|
1228
1234
|
import { sync } from "fast-glob";
|
|
1229
1235
|
import fs from "fs-extra";
|
|
1230
1236
|
import { Octokit } from "octokit";
|
|
1231
|
-
import { join as
|
|
1237
|
+
import { join as join4 } from "path";
|
|
1232
1238
|
async function runCodeowners() {
|
|
1233
1239
|
const config = await getConfig();
|
|
1234
1240
|
if (!config) {
|
|
1235
1241
|
throw new Error("Failed to load storm config.");
|
|
1236
1242
|
}
|
|
1237
|
-
const codeowners = fs.readFileSync(fs.existsSync(
|
|
1243
|
+
const codeowners = fs.readFileSync(fs.existsSync(join4(config.workspaceRoot, ".github", "CODEOWNERS")) ? join4(config.workspaceRoot, ".github", "CODEOWNERS") : join4(config.workspaceRoot, "CODEOWNERS"), "utf8");
|
|
1238
1244
|
const codeownersLines = codeowners.split("\n").filter((line) => line.trim().length > 0 && !line.startsWith("#"));
|
|
1239
1245
|
const mismatchedPatterns = [];
|
|
1240
1246
|
const mismatchedOwners = [];
|
|
@@ -1259,7 +1265,7 @@ async function runCodeowners() {
|
|
|
1259
1265
|
"tmp",
|
|
1260
1266
|
".git"
|
|
1261
1267
|
],
|
|
1262
|
-
cwd:
|
|
1268
|
+
cwd: join4(config.workspaceRoot),
|
|
1263
1269
|
onlyFiles: false
|
|
1264
1270
|
}).length > 0;
|
|
1265
1271
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -206,21 +206,27 @@ var _promises = require('fs/promises');
|
|
|
206
206
|
var _path = require('path');
|
|
207
207
|
|
|
208
208
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
209
|
-
|
|
209
|
+
|
|
210
|
+
var removeWindowsDriveLetter = /* @__PURE__ */ __name((osSpecificPath) => {
|
|
211
|
+
return osSpecificPath.replace(/^[A-Z]:/, "");
|
|
212
|
+
}, "removeWindowsDriveLetter");
|
|
210
213
|
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
211
214
|
if (!path) {
|
|
212
215
|
return "";
|
|
213
216
|
}
|
|
214
|
-
if (
|
|
215
|
-
path
|
|
217
|
+
if (path.includes("\\")) {
|
|
218
|
+
if (!path.toUpperCase().startsWith("C:")) {
|
|
219
|
+
path = `C:${path}`;
|
|
220
|
+
}
|
|
221
|
+
return path.replaceAll("/", "\\");
|
|
216
222
|
}
|
|
217
|
-
return path.
|
|
223
|
+
return removeWindowsDriveLetter(path).split("\\").join("/");
|
|
218
224
|
}, "correctPaths");
|
|
219
225
|
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
220
226
|
if (!paths || paths.length === 0) {
|
|
221
227
|
return "";
|
|
222
228
|
}
|
|
223
|
-
return correctPaths(
|
|
229
|
+
return correctPaths(_path.join.call(void 0, ...paths));
|
|
224
230
|
}, "joinPaths");
|
|
225
231
|
|
|
226
232
|
// ../config-tools/src/utilities/find-up.ts
|
package/dist/index.js
CHANGED
|
@@ -203,38 +203,44 @@ var COLOR_KEYS = [
|
|
|
203
203
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
204
204
|
import { existsSync as existsSync2 } from "node:fs";
|
|
205
205
|
import { readFile } from "node:fs/promises";
|
|
206
|
-
import { join as
|
|
206
|
+
import { join as join3 } from "node:path";
|
|
207
207
|
|
|
208
208
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
209
|
-
import {
|
|
209
|
+
import { join } from "node:path";
|
|
210
|
+
var removeWindowsDriveLetter = /* @__PURE__ */ __name((osSpecificPath) => {
|
|
211
|
+
return osSpecificPath.replace(/^[A-Z]:/, "");
|
|
212
|
+
}, "removeWindowsDriveLetter");
|
|
210
213
|
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
211
214
|
if (!path) {
|
|
212
215
|
return "";
|
|
213
216
|
}
|
|
214
|
-
if (
|
|
215
|
-
path
|
|
217
|
+
if (path.includes("\\")) {
|
|
218
|
+
if (!path.toUpperCase().startsWith("C:")) {
|
|
219
|
+
path = `C:${path}`;
|
|
220
|
+
}
|
|
221
|
+
return path.replaceAll("/", "\\");
|
|
216
222
|
}
|
|
217
|
-
return path.
|
|
223
|
+
return removeWindowsDriveLetter(path).split("\\").join("/");
|
|
218
224
|
}, "correctPaths");
|
|
219
225
|
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
220
226
|
if (!paths || paths.length === 0) {
|
|
221
227
|
return "";
|
|
222
228
|
}
|
|
223
|
-
return correctPaths(
|
|
229
|
+
return correctPaths(join(...paths));
|
|
224
230
|
}, "joinPaths");
|
|
225
231
|
|
|
226
232
|
// ../config-tools/src/utilities/find-up.ts
|
|
227
233
|
import { existsSync } from "node:fs";
|
|
228
|
-
import { join } from "node:path";
|
|
234
|
+
import { join as join2 } from "node:path";
|
|
229
235
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
230
236
|
var depth = 0;
|
|
231
237
|
function findFolderUp(startPath, endFileNames) {
|
|
232
238
|
const _startPath = startPath ?? process.cwd();
|
|
233
|
-
if (endFileNames.some((endFileName) => existsSync(
|
|
239
|
+
if (endFileNames.some((endFileName) => existsSync(join2(_startPath, endFileName)))) {
|
|
234
240
|
return _startPath;
|
|
235
241
|
}
|
|
236
242
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
237
|
-
const parent =
|
|
243
|
+
const parent = join2(_startPath, "..");
|
|
238
244
|
return findFolderUp(parent, endFileNames);
|
|
239
245
|
}
|
|
240
246
|
return void 0;
|
|
@@ -331,7 +337,7 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
331
337
|
let namespace = void 0;
|
|
332
338
|
let repository = void 0;
|
|
333
339
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
334
|
-
if (existsSync2(
|
|
340
|
+
if (existsSync2(join3(workspaceRoot, "package.json"))) {
|
|
335
341
|
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
336
342
|
if (file) {
|
|
337
343
|
const packageJson = JSON.parse(file);
|
|
@@ -1193,13 +1199,13 @@ var transform = /* @__PURE__ */ __name((options) => {
|
|
|
1193
1199
|
import { sync } from "fast-glob";
|
|
1194
1200
|
import fs from "fs-extra";
|
|
1195
1201
|
import { Octokit } from "octokit";
|
|
1196
|
-
import { join as
|
|
1202
|
+
import { join as join4 } from "path";
|
|
1197
1203
|
async function runCodeowners() {
|
|
1198
1204
|
const config = await getConfig();
|
|
1199
1205
|
if (!config) {
|
|
1200
1206
|
throw new Error("Failed to load storm config.");
|
|
1201
1207
|
}
|
|
1202
|
-
const codeowners = fs.readFileSync(fs.existsSync(
|
|
1208
|
+
const codeowners = fs.readFileSync(fs.existsSync(join4(config.workspaceRoot, ".github", "CODEOWNERS")) ? join4(config.workspaceRoot, ".github", "CODEOWNERS") : join4(config.workspaceRoot, "CODEOWNERS"), "utf8");
|
|
1203
1209
|
const codeownersLines = codeowners.split("\n").filter((line) => line.trim().length > 0 && !line.startsWith("#"));
|
|
1204
1210
|
const mismatchedPatterns = [];
|
|
1205
1211
|
const mismatchedOwners = [];
|
|
@@ -1224,7 +1230,7 @@ async function runCodeowners() {
|
|
|
1224
1230
|
"tmp",
|
|
1225
1231
|
".git"
|
|
1226
1232
|
],
|
|
1227
|
-
cwd:
|
|
1233
|
+
cwd: join4(config.workspaceRoot),
|
|
1228
1234
|
onlyFiles: false
|
|
1229
1235
|
}).length > 0;
|
|
1230
1236
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/linting-tools",
|
|
3
|
-
"version": "1.107.
|
|
3
|
+
"version": "1.107.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "⚡ A package containing various linting tools used to validate syntax, enforce design standards, and format code in a Storm workspace.",
|
|
6
6
|
"repository": {
|
|
@@ -133,7 +133,6 @@
|
|
|
133
133
|
"vfile-reporter": "8.1.1"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@storm-software/cspell": "0.8.4",
|
|
137
136
|
"@types/node": "^22.10.2",
|
|
138
137
|
"cspell": "8.8.4",
|
|
139
138
|
"tsup": "8.3.5"
|