eslint-plugin-better-stylelint 2.0.5 → 2.1.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/dist/index.js +2 -23
- package/dist/worker.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
1
|
import { execFileSync } from "node:child_process";
|
|
3
2
|
import { createHash } from "node:crypto";
|
|
4
|
-
import fs from "node:fs";
|
|
5
|
-
import os from "node:os";
|
|
6
3
|
import path from "node:path";
|
|
7
4
|
import process from "node:process";
|
|
8
|
-
import { fileURLToPath
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
9
6
|
//#region src/core.ts
|
|
10
7
|
const MAX_CACHE_ENTRIES = 100;
|
|
11
|
-
const CORE_TS_PATTERN = /core\.ts$/u;
|
|
12
8
|
const CORE_JS_PATTERN = /core\.js$/u;
|
|
13
|
-
const WORKER_BOOTSTRAP_PREFIX = "icebreaker-stylelint-worker-";
|
|
14
9
|
const resultCache = /* @__PURE__ */ new Map();
|
|
15
10
|
const configCacheIds = /* @__PURE__ */ new WeakMap();
|
|
16
11
|
let nextConfigCacheId = 0;
|
|
17
|
-
const require = createRequire(import.meta.url);
|
|
18
12
|
const UNSUPPORTED_EXEC_ARGV_FLAGS = /* @__PURE__ */ new Set([
|
|
19
13
|
"--eval",
|
|
20
14
|
"-e",
|
|
@@ -86,7 +80,7 @@ function setCachedMessages(cacheKey, messages) {
|
|
|
86
80
|
}
|
|
87
81
|
function resolveWorkerPath() {
|
|
88
82
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
89
|
-
if (currentFilePath.endsWith(".ts")) return
|
|
83
|
+
if (currentFilePath.endsWith(".ts")) return path.resolve(path.dirname(currentFilePath), "../dist/worker.js");
|
|
90
84
|
return currentFilePath.replace(CORE_JS_PATTERN, "worker.js");
|
|
91
85
|
}
|
|
92
86
|
function getWorkerExecArgv() {
|
|
@@ -107,21 +101,6 @@ function getWorkerExecArgv() {
|
|
|
107
101
|
return workerExecArgv;
|
|
108
102
|
}
|
|
109
103
|
function resolveWorkerCommand(workerPath) {
|
|
110
|
-
if (workerPath.endsWith(".ts")) {
|
|
111
|
-
const workerEntry = pathToFileURL(workerPath).href;
|
|
112
|
-
const tsxLoaderEntry = pathToFileURL(require.resolve("tsx/esm")).href;
|
|
113
|
-
const bootstrapPath = path.join(os.tmpdir(), `${WORKER_BOOTSTRAP_PREFIX}${createHash("sha1").update(workerEntry).digest("hex")}.mjs`);
|
|
114
|
-
if (!fs.existsSync(bootstrapPath)) fs.writeFileSync(bootstrapPath, `import ${JSON.stringify(workerEntry)}\n`, "utf8");
|
|
115
|
-
return {
|
|
116
|
-
command: process.execPath,
|
|
117
|
-
args: [
|
|
118
|
-
...getWorkerExecArgv(),
|
|
119
|
-
"--import",
|
|
120
|
-
tsxLoaderEntry,
|
|
121
|
-
bootstrapPath
|
|
122
|
-
]
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
104
|
return {
|
|
126
105
|
command: process.execPath,
|
|
127
106
|
args: [...getWorkerExecArgv(), workerPath]
|
package/dist/worker.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import fs from "node:fs";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import process from "node:process";
|
|
5
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
import fs from "node:fs";
|
|
6
6
|
//#region src/worker.ts
|
|
7
7
|
function normalizeWarning(warning) {
|
|
8
8
|
return {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-better-stylelint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"description": "Bridge Stylelint diagnostics into ESLint for style files and Vue SFCs",
|
|
6
|
-
"author": "ice breaker <
|
|
6
|
+
"author": "ice breaker <hi@sonofmagic.top>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://repoctl.icebreaker.top",
|
|
9
9
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"engines": {
|
|
39
|
-
"node": ">=22.
|
|
39
|
+
"node": ">=22.13.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"eslint": "^9.0.0 || ^10.0.0",
|