vite-doctor 0.0.10 → 0.0.11
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/cli.mjs +2 -2
- package/dist/{core-CztxQ3dO.mjs → core-5H46uz1F.mjs} +82 -28
- package/dist/{doctor-DZThqTQg.mjs → doctor-B958tLHH.mjs} +9 -9
- package/dist/{index-BjF8I0Dg.d.mts → index-B7XDlLUv.d.mts} +4 -1
- package/dist/{index-CzHsaAnb.d.mts → index-BfWPREhz.d.mts} +13 -1
- package/dist/index.mjs +1 -1
- package/dist/nitro-EqEXN3xl.mjs +2 -0
- package/dist/{plugin-DXJRUrg6.mjs → plugin-CHGOylSB.mjs} +2 -2
- package/dist/plugin.mjs +1 -1
- package/dist/rule-packs/nitro/index.mjs +2 -2
- package/dist/rule-packs/nitro/rules.mjs +1 -1
- package/dist/rule-packs/nuxt/rules/index.mjs +2 -2
- package/dist/rule-packs/typescript/index.d.mts +2 -2
- package/dist/rule-packs/typescript/index.mjs +3 -3
- package/dist/rule-packs/typescript/rules/index.d.mts +2 -2
- package/dist/rule-packs/typescript/rules/index.mjs +2 -2
- package/dist/rule-packs/vite/index.d.mts +2 -2
- package/dist/rule-packs/vite/index.mjs +2 -2
- package/dist/rule-packs/vite/rules/index.d.mts +2 -2
- package/dist/rule-packs/vite/rules/index.mjs +2 -2
- package/dist/rule-packs/vue/index.mjs +1 -1
- package/dist/rule-packs/vue/rules.mjs +1 -1
- package/dist/{rules-D228x7hu.mjs → rules-3_HzDOVa.mjs} +55 -4
- package/dist/rules-BGNn6i06.mjs +1388 -0
- package/dist/{rules-Cg6CMffp.mjs → rules-BVgdxeWW.mjs} +4 -4
- package/dist/{rules-298lNPbq.mjs → rules-C84ec1qL.mjs} +1 -1
- package/dist/{rules-BfmRH-w3.mjs → rules-Cljb26cQ.mjs} +1 -1
- package/dist/rules-D6_7S4VU.mjs +2 -0
- package/dist/rules.d.mts +2 -2
- package/dist/rules.mjs +3 -3
- package/dist/typescript-CkZ5kHgI.mjs +2 -0
- package/package.json +1 -1
- package/dist/nitro-FnvPw8Up.mjs +0 -2
- package/dist/rules-03OSDgOR.mjs +0 -635
- package/dist/rules-htE_WDPD.mjs +0 -2
- package/dist/typescript-etB5nu2i.mjs +0 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as reportStatus,
|
|
2
|
+
import { a as reportStatus, i as explainRule, l as detectProject, n as createReport, o as cleanCache, r as createRulesReport, s as evaluateRuleApplicability } from "./core-5H46uz1F.mjs";
|
|
3
3
|
import { n as loadDoctorConfig } from "./config-CaJ0DqB3.mjs";
|
|
4
|
-
import { i as viteDoctorVersion, n as shouldFailDoctorRun, r as viteDoctorRulePacks, t as runViteDoctor } from "./doctor-
|
|
4
|
+
import { i as viteDoctorVersion, n as shouldFailDoctorRun, r as viteDoctorRulePacks, t as runViteDoctor } from "./doctor-B958tLHH.mjs";
|
|
5
5
|
import { relative, resolve } from "pathe";
|
|
6
6
|
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
@@ -16,10 +16,11 @@ import pc from "picocolors";
|
|
|
16
16
|
//#region src/core/internal/script.ts
|
|
17
17
|
function parseScript(file, source, lang = langFromFile(file)) {
|
|
18
18
|
try {
|
|
19
|
-
|
|
19
|
+
const result = parseSync(file, source, {
|
|
20
20
|
sourceType: "module",
|
|
21
21
|
lang
|
|
22
|
-
})
|
|
22
|
+
});
|
|
23
|
+
return Object.assign(result.program, { comments: result.comments });
|
|
23
24
|
} catch {
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
@@ -739,7 +740,9 @@ async function collectGitChangeInventory(root, since, includePath = () => true)
|
|
|
739
740
|
});
|
|
740
741
|
}
|
|
741
742
|
for (const path of untracked.paths.filter(includePath)) {
|
|
742
|
-
const
|
|
743
|
+
const absolute = resolve(root, path);
|
|
744
|
+
if (!statSync(absolute, { throwIfNoEntry: false })?.isFile()) continue;
|
|
745
|
+
const lineCount = currentLineCount(absolute);
|
|
743
746
|
changes.push({
|
|
744
747
|
kind: "untracked",
|
|
745
748
|
path,
|
|
@@ -835,8 +838,10 @@ async function collectFileHunks(root, base, path, previousPath, ref) {
|
|
|
835
838
|
const result = await runGit(root, [
|
|
836
839
|
"diff",
|
|
837
840
|
"--unified=0",
|
|
841
|
+
"--inter-hunk-context=0",
|
|
838
842
|
"--no-color",
|
|
839
843
|
"--no-ext-diff",
|
|
844
|
+
"--no-textconv",
|
|
840
845
|
base,
|
|
841
846
|
"--",
|
|
842
847
|
...previousPath ? [previousPath] : [],
|
|
@@ -1837,6 +1842,7 @@ function safeCacheKey(key) {
|
|
|
1837
1842
|
}
|
|
1838
1843
|
//#endregion
|
|
1839
1844
|
//#region src/core/internal/facts.ts
|
|
1845
|
+
const FILE_FACTS_VERSION = 2;
|
|
1840
1846
|
async function parseSourceFiles(session) {
|
|
1841
1847
|
const started = performance.now();
|
|
1842
1848
|
let fileId = 0;
|
|
@@ -1851,7 +1857,7 @@ async function parseSourceFile(session, file, fileId) {
|
|
|
1851
1857
|
const absolute = file.path;
|
|
1852
1858
|
const text = readFileSync(absolute, "utf8");
|
|
1853
1859
|
const hash = sha256(text);
|
|
1854
|
-
const cacheKey = createCacheKey(session, "fileFacts", `${absolute}:${hash}`);
|
|
1860
|
+
const cacheKey = createCacheKey(session, "fileFacts", `${FILE_FACTS_VERSION}:${absolute}:${hash}`);
|
|
1855
1861
|
const cachedFacts = session.cache.get(cacheKey);
|
|
1856
1862
|
const isVueSfc = absolute.endsWith(".vue");
|
|
1857
1863
|
const sfc = isVueSfc ? await parseOptionalSfc(absolute, text, hash) : void 0;
|
|
@@ -1935,6 +1941,10 @@ function createFileFacts(session, file, fileId, text, hash, scriptAst, templateA
|
|
|
1935
1941
|
source: String(node.source?.value ?? ""),
|
|
1936
1942
|
range: nodeRange(session, file.path, text, node)
|
|
1937
1943
|
});
|
|
1944
|
+
else if (node.type === "ImportExpression") dynamicImports.push({
|
|
1945
|
+
source: typeof node.source?.value === "string" ? node.source.value : null,
|
|
1946
|
+
range: nodeRange(session, file.path, text, node)
|
|
1947
|
+
});
|
|
1938
1948
|
else if (node.type === "CallExpression") {
|
|
1939
1949
|
const name = session.helpers.getCalleeName(node);
|
|
1940
1950
|
if (name) {
|
|
@@ -2071,11 +2081,11 @@ function createTokenFacts(text) {
|
|
|
2071
2081
|
//#region src/core/internal/rule-runner.ts
|
|
2072
2082
|
async function runVisitor(visitor, file) {
|
|
2073
2083
|
if (file.sfc) await visitor.SFC?.(file.sfc);
|
|
2074
|
-
if (file.scriptAst) walkScript(file.scriptAst, (node) => {
|
|
2084
|
+
if (file.scriptAst && (visitor.ScriptNode || visitor.ImportDeclaration)) walkScript(file.scriptAst, (node) => {
|
|
2075
2085
|
visitor.ScriptNode?.(node);
|
|
2076
2086
|
if (node.type === "ImportDeclaration") visitor.ImportDeclaration?.(node);
|
|
2077
2087
|
});
|
|
2078
|
-
if (file.templateAst) walkTemplate(file.templateAst, (node) => visitor.TemplateNode?.(node));
|
|
2088
|
+
if (file.templateAst && visitor.TemplateNode) walkTemplate(file.templateAst, (node) => visitor.TemplateNode?.(node));
|
|
2079
2089
|
}
|
|
2080
2090
|
function walkScript(node, visit, parent) {
|
|
2081
2091
|
if (!node || typeof node !== "object") return;
|
|
@@ -2113,10 +2123,11 @@ function walkTemplate(node, visit) {
|
|
|
2113
2123
|
//#region src/core/internal/diagnostic-policy.ts
|
|
2114
2124
|
function applyDiagnosticPolicy(input) {
|
|
2115
2125
|
const suppressed = [];
|
|
2126
|
+
const sourceLines = /* @__PURE__ */ new Map();
|
|
2116
2127
|
const baseline = readBaseline(input.root, input.options.baseline);
|
|
2117
2128
|
const nextDiagnostics = [];
|
|
2118
2129
|
for (const diagnostic of input.diagnostics) {
|
|
2119
|
-
const suppression = findSuppression(input.root, input.config, diagnostic);
|
|
2130
|
+
const suppression = findSuppression(input.root, input.config, diagnostic, sourceLines);
|
|
2120
2131
|
const inBaseline = baseline.has(diagnostic.fingerprint ?? "");
|
|
2121
2132
|
if (suppression || input.options.newOnly && inBaseline) {
|
|
2122
2133
|
suppressed.push({
|
|
@@ -2167,7 +2178,7 @@ function writeBaseline(root, baseline, diagnostics) {
|
|
|
2167
2178
|
})).sort((a, b) => `${a.ruleId}:${a.file}:${a.fingerprint}`.localeCompare(`${b.ruleId}:${b.file}:${b.fingerprint}`))
|
|
2168
2179
|
}, null, 2)}\n`);
|
|
2169
2180
|
}
|
|
2170
|
-
function findSuppression(root, config, diagnostic) {
|
|
2181
|
+
function findSuppression(root, config, diagnostic, sourceLines) {
|
|
2171
2182
|
const configured = config.suppressions?.find((suppression) => {
|
|
2172
2183
|
if (suppression.ruleId && suppression.ruleId !== diagnostic.ruleId) return false;
|
|
2173
2184
|
if (suppression.fingerprint && suppression.fingerprint !== diagnostic.fingerprint) return false;
|
|
@@ -2175,14 +2186,26 @@ function findSuppression(root, config, diagnostic) {
|
|
|
2175
2186
|
return true;
|
|
2176
2187
|
});
|
|
2177
2188
|
if (configured) return configured.reason;
|
|
2178
|
-
|
|
2189
|
+
let lines = sourceLines.get(diagnostic.file);
|
|
2190
|
+
if (!lines) {
|
|
2191
|
+
try {
|
|
2192
|
+
lines = readFileSync(diagnostic.file, "utf8").split(/\r?\n/);
|
|
2193
|
+
} catch {
|
|
2194
|
+
lines = [];
|
|
2195
|
+
}
|
|
2196
|
+
sourceLines.set(diagnostic.file, lines);
|
|
2197
|
+
}
|
|
2179
2198
|
const line = diagnostic.range?.line;
|
|
2180
|
-
const
|
|
2181
|
-
const
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2199
|
+
const start = line ? Math.max(0, line - 3) : 0;
|
|
2200
|
+
const end = line ? Math.min(lines.length, line + 1) : lines.length;
|
|
2201
|
+
for (let index = start; index < end; index++) {
|
|
2202
|
+
const inline = lines[index].match(/doctor-disable(-next-line)?\s+([^\s]+)(?:\s+--\s+(.+)|\s+(.+))?/);
|
|
2203
|
+
if (!inline || inline[1] && line !== index + 2) continue;
|
|
2204
|
+
const rules = inline[2].split(",").map((item) => item.trim());
|
|
2205
|
+
if (!rules.includes(diagnostic.ruleId) && !rules.includes("*")) continue;
|
|
2206
|
+
return (inline[3] ?? inline[4] ?? "").trim() || "missing suppression reason";
|
|
2207
|
+
}
|
|
2208
|
+
return null;
|
|
2186
2209
|
}
|
|
2187
2210
|
function nativeMatch(value, pattern) {
|
|
2188
2211
|
if (pattern === value) return true;
|
|
@@ -2521,6 +2544,10 @@ const allDoctorDiagnosticRegistry = defineDoctorDiagnostics([
|
|
|
2521
2544
|
code: "VITE0021",
|
|
2522
2545
|
ruleId: "vite/worker/require-worker-url-pattern"
|
|
2523
2546
|
},
|
|
2547
|
+
{
|
|
2548
|
+
code: "VITE0022",
|
|
2549
|
+
ruleId: "vite/imports/require-static-glob-pattern"
|
|
2550
|
+
},
|
|
2524
2551
|
{
|
|
2525
2552
|
code: "TS0001",
|
|
2526
2553
|
ruleId: "typescript/evidence/no-chained-type-assertions"
|
|
@@ -2553,6 +2580,10 @@ const allDoctorDiagnosticRegistry = defineDoctorDiagnostics([
|
|
|
2553
2580
|
code: "TS0008",
|
|
2554
2581
|
ruleId: "typescript/strict/require-safety-comment-for-type-assertion"
|
|
2555
2582
|
},
|
|
2583
|
+
{
|
|
2584
|
+
code: "TS0012",
|
|
2585
|
+
ruleId: "typescript/performance/no-array-filter-map"
|
|
2586
|
+
},
|
|
2556
2587
|
{
|
|
2557
2588
|
code: "NITRO0001",
|
|
2558
2589
|
ruleId: "nitro/context/no-navigateto-in-nitro"
|
|
@@ -3033,7 +3064,7 @@ function createResult(project, root, diagnostics, suppressedDiagnostics, config,
|
|
|
3033
3064
|
function createDiagnosticFingerprint(root, diagnostic, file) {
|
|
3034
3065
|
const rel = relative(root, diagnostic.file);
|
|
3035
3066
|
const anchor = nearestAnchor(file.text, diagnostic.range?.start ?? 0);
|
|
3036
|
-
const message = diagnostic.why.replace(/\s+/g, " ")
|
|
3067
|
+
const message = diagnostic.why.replace(/\s+/g, " ");
|
|
3037
3068
|
return sha256(`${diagnostic.ruleId}:${rel}:${anchor}:${message}`);
|
|
3038
3069
|
}
|
|
3039
3070
|
function normalizeDiagnostic(input) {
|
|
@@ -3198,11 +3229,6 @@ function buildWorkspaceGraph(session) {
|
|
|
3198
3229
|
specifier: item.source,
|
|
3199
3230
|
kind: item.kind === "type" ? "type-import" : "import"
|
|
3200
3231
|
});
|
|
3201
|
-
if (target !== void 0) {
|
|
3202
|
-
const importers = importersByFile.get(target) ?? [];
|
|
3203
|
-
importers.push(fact.fileId);
|
|
3204
|
-
importersByFile.set(target, importers);
|
|
3205
|
-
}
|
|
3206
3232
|
for (const specifier of item.specifiers) {
|
|
3207
3233
|
const refs = refsByExport.get(specifier) ?? [];
|
|
3208
3234
|
refs.push({
|
|
@@ -3212,6 +3238,15 @@ function buildWorkspaceGraph(session) {
|
|
|
3212
3238
|
refsByExport.set(specifier, refs);
|
|
3213
3239
|
}
|
|
3214
3240
|
}
|
|
3241
|
+
for (const item of fact.dynamicImports) {
|
|
3242
|
+
if (item.source === null) continue;
|
|
3243
|
+
importEdges.push({
|
|
3244
|
+
from: fact.fileId,
|
|
3245
|
+
to: resolveImportTarget(session, fact, item.source, byRelativePath),
|
|
3246
|
+
specifier: item.source,
|
|
3247
|
+
kind: "dynamic-import"
|
|
3248
|
+
});
|
|
3249
|
+
}
|
|
3215
3250
|
for (const item of fact.calls) {
|
|
3216
3251
|
const refs = refsByExport.get(item.name) ?? [];
|
|
3217
3252
|
refs.push({
|
|
@@ -3221,6 +3256,12 @@ function buildWorkspaceGraph(session) {
|
|
|
3221
3256
|
refsByExport.set(item.name, refs);
|
|
3222
3257
|
}
|
|
3223
3258
|
}
|
|
3259
|
+
for (const edge of [...importEdges, ...exportEdges]) {
|
|
3260
|
+
if (edge.to === void 0) continue;
|
|
3261
|
+
const importers = importersByFile.get(edge.to) ?? [];
|
|
3262
|
+
importers.push(edge.from);
|
|
3263
|
+
importersByFile.set(edge.to, importers);
|
|
3264
|
+
}
|
|
3224
3265
|
const virtualRoots = createVirtualRoots(session, fileIdsByPath);
|
|
3225
3266
|
for (const root of virtualRoots) {
|
|
3226
3267
|
if (root.fileId === void 0) continue;
|
|
@@ -3242,7 +3283,7 @@ function buildWorkspaceGraph(session) {
|
|
|
3242
3283
|
refsByExport,
|
|
3243
3284
|
exportsByName
|
|
3244
3285
|
},
|
|
3245
|
-
sccs: computeSccs(session.facts.map((fact) => fact.fileId), importEdges)
|
|
3286
|
+
sccs: computeSccs(session.facts.map((fact) => fact.fileId), [...importEdges.filter((edge) => edge.kind !== "dynamic-import"), ...exportEdges])
|
|
3246
3287
|
};
|
|
3247
3288
|
}
|
|
3248
3289
|
function createVirtualRoots(session, fileIdsByPath) {
|
|
@@ -3366,9 +3407,15 @@ function runDeadCodeRules(session, graph) {
|
|
|
3366
3407
|
const live = reachableFiles(graph);
|
|
3367
3408
|
const packageDeps = readPackageDeps(session.root);
|
|
3368
3409
|
const importedPackages = /* @__PURE__ */ new Set();
|
|
3369
|
-
|
|
3410
|
+
const byRelativePath = new Map(session.facts.map((fact) => [fact.relativePath, fact.fileId]));
|
|
3411
|
+
for (const fact of session.facts) for (const item of [
|
|
3412
|
+
...fact.imports,
|
|
3413
|
+
...fact.exports,
|
|
3414
|
+
...fact.dynamicImports
|
|
3415
|
+
]) {
|
|
3416
|
+
if (!item.source) continue;
|
|
3370
3417
|
if (!item.source.startsWith(".") && !item.source.startsWith("~/") && !item.source.startsWith("@/") && !item.source.startsWith("~~/")) importedPackages.add(packageNameFromSpecifier(item.source));
|
|
3371
|
-
if (isLocalSpecifier(item.source) && !isGeneratedOrAssetImport(item.source) && !isLikelyForeignFrameworkFile(session, fact.relativePath, packageDeps) && resolveImportTarget(session, fact, item.source,
|
|
3418
|
+
if (isLocalSpecifier(item.source) && !isGeneratedOrAssetImport(item.source) && !isLikelyForeignFrameworkFile(session, fact.relativePath, packageDeps) && resolveImportTarget(session, fact, item.source, byRelativePath) === void 0) pushDiagnostic(session, {
|
|
3372
3419
|
ruleId: "workspace/dead-code/unresolved-import",
|
|
3373
3420
|
severity: "error",
|
|
3374
3421
|
category: "dead-code",
|
|
@@ -3562,13 +3609,20 @@ function selectedAnalyses(session) {
|
|
|
3562
3609
|
}
|
|
3563
3610
|
function reachableFiles(graph) {
|
|
3564
3611
|
const live = /* @__PURE__ */ new Set();
|
|
3612
|
+
const targetsByFile = /* @__PURE__ */ new Map();
|
|
3613
|
+
for (const edge of [...graph.importEdges, ...graph.exportEdges]) {
|
|
3614
|
+
if (edge.to === void 0) continue;
|
|
3615
|
+
const targets = targetsByFile.get(edge.from) ?? [];
|
|
3616
|
+
targets.push(edge.to);
|
|
3617
|
+
targetsByFile.set(edge.from, targets);
|
|
3618
|
+
}
|
|
3565
3619
|
const queue = graph.virtualRoots.flatMap((root) => root.fileId === void 0 ? [] : [root.fileId]);
|
|
3566
3620
|
for (const fact of graph.files.values()) if (fact.exports.some((item) => graph.reverseIndex.refsByExport.has(item.name))) queue.push(fact.fileId);
|
|
3567
|
-
|
|
3568
|
-
const id = queue
|
|
3621
|
+
for (let index = 0; index < queue.length; index++) {
|
|
3622
|
+
const id = queue[index];
|
|
3569
3623
|
if (live.has(id)) continue;
|
|
3570
3624
|
live.add(id);
|
|
3571
|
-
for (const
|
|
3625
|
+
for (const target of targetsByFile.get(id) ?? []) if (!live.has(target)) queue.push(target);
|
|
3572
3626
|
}
|
|
3573
3627
|
return live;
|
|
3574
3628
|
}
|
|
@@ -4393,4 +4447,4 @@ async function executeDoctorRun(options) {
|
|
|
4393
4447
|
return result;
|
|
4394
4448
|
}
|
|
4395
4449
|
//#endregion
|
|
4396
|
-
export { reportStatus as a,
|
|
4450
|
+
export { reportStatus as a, getNodeVisitorKeys as c, explainRule as i, detectProject as l, createReport as n, cleanCache as o, createRulesReport as r, evaluateRuleApplicability as s, runDoctor as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as runDoctor } from "./core-
|
|
1
|
+
import { t as runDoctor } from "./core-5H46uz1F.mjs";
|
|
2
2
|
import { o as defineDoctorExtension } from "./diagnostics-OWBdo3Uc.mjs";
|
|
3
|
-
import { t as nitroRulePack } from "./rules-
|
|
4
|
-
import "./nitro-
|
|
5
|
-
import { t as vueRulePack } from "./rules-
|
|
6
|
-
import { t as nuxtDoctorExtensions } from "./rules-
|
|
7
|
-
import { t as viteRulePack } from "./rules-
|
|
8
|
-
import "./rules-
|
|
9
|
-
import { t as typescriptRulePack } from "./rules-
|
|
10
|
-
import "./typescript-
|
|
3
|
+
import { t as nitroRulePack } from "./rules-Cljb26cQ.mjs";
|
|
4
|
+
import "./nitro-EqEXN3xl.mjs";
|
|
5
|
+
import { t as vueRulePack } from "./rules-C84ec1qL.mjs";
|
|
6
|
+
import { t as nuxtDoctorExtensions } from "./rules-BVgdxeWW.mjs";
|
|
7
|
+
import { t as viteRulePack } from "./rules-3_HzDOVa.mjs";
|
|
8
|
+
import "./rules-D6_7S4VU.mjs";
|
|
9
|
+
import { t as typescriptRulePack } from "./rules-BGNn6i06.mjs";
|
|
10
|
+
import "./typescript-CkZ5kHgI.mjs";
|
|
11
11
|
import { join } from "pathe";
|
|
12
12
|
import { existsSync, readFileSync } from "node:fs";
|
|
13
13
|
//#region src/version.ts
|
|
@@ -25,6 +25,9 @@ declare const noNodeApiInWorker: DoctorRule;
|
|
|
25
25
|
//#region src/rule-packs/vite/rules/ssr.d.ts
|
|
26
26
|
declare const noBrowserGlobalInSsrEntry: DoctorRule;
|
|
27
27
|
//#endregion
|
|
28
|
+
//#region src/rule-packs/vite/rules/imports.d.ts
|
|
29
|
+
declare const requireStaticGlobPattern: DoctorRule;
|
|
30
|
+
//#endregion
|
|
28
31
|
//#region src/rule-packs/vite/rules/server.d.ts
|
|
29
32
|
declare const noDisabledFsStrict: DoctorRule;
|
|
30
33
|
declare const noBroadFsAllow: DoctorRule;
|
|
@@ -37,4 +40,4 @@ declare const requireDisposeForSideEffects: DoctorRule;
|
|
|
37
40
|
//#region src/rule-packs/vite/rules/index.d.ts
|
|
38
41
|
declare const viteRulePack: RulePack;
|
|
39
42
|
//#endregion
|
|
40
|
-
export { noUnusedDefine as S,
|
|
43
|
+
export { noUnusedDefine as C, noUntypedDefine as S, noEmptyEnvPrefix as _, noBroadFsAllow as a, noRuntimeObjectDefine as b, noBrowserGlobalInSsrEntry as c, requireWorkerUrlPattern as d, noDynamicNewUrl as f, noClientSecretPattern as g, noBroadEnvPrefix as h, requirePluginName as i, noDynamicWorkerUrl as l, noSrcAbsolutePublicUrl as m, preferTransformFilter as n, noDisabledFsStrict as o, noPublicSrcImport as p, requireDisposeForSideEffects as r, requireStaticGlobPattern as s, viteRulePack as t, noNodeApiInWorker as u, noUntypedEnv as v, noSecretDefine as x, preferDirectImportMetaEnvAccess as y };
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { a as DoctorRule, d as RulePack } from "./primitives-8DoGel1u.mjs";
|
|
2
|
+
//#region src/rule-packs/typescript/rules/no-array-filter-map.d.ts
|
|
3
|
+
declare const noArrayFilterMap: DoctorRule;
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/rule-packs/typescript/rules/no-known-value-widening.d.ts
|
|
6
|
+
declare const noKnownValueWidening: DoctorRule;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/rule-packs/typescript/rules/no-widen-then-assert.d.ts
|
|
9
|
+
declare const noWidenThenAssert: DoctorRule;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/rule-packs/typescript/rules/no-reduce-accumulator-copy.d.ts
|
|
12
|
+
declare const noReduceAccumulatorCopy: DoctorRule;
|
|
13
|
+
//#endregion
|
|
2
14
|
//#region src/rule-packs/typescript/rules/no-caller-chosen-result-type.d.ts
|
|
3
15
|
declare const noCallerChosenResultType: DoctorRule;
|
|
4
16
|
//#endregion
|
|
@@ -26,4 +38,4 @@ declare const requireSafetyCommentForTypeAssertion: DoctorRule;
|
|
|
26
38
|
//#region src/rule-packs/typescript/rules/index.d.ts
|
|
27
39
|
declare const typescriptRulePack: RulePack;
|
|
28
40
|
//#endregion
|
|
29
|
-
export { noRuntimeTypeof as a, noChainedTypeAssertions as c, noUnknownTypeAliases as i, noCallerChosenResultType as l, requireSafetyCommentForTypeAssertion as n, noObjectParameters as o, noUnvalidatedDeserialization as r, noConditionalEmptyObjectSpread as s, typescriptRulePack as t };
|
|
41
|
+
export { noRuntimeTypeof as a, noChainedTypeAssertions as c, noWidenThenAssert as d, noKnownValueWidening as f, noUnknownTypeAliases as i, noCallerChosenResultType as l, requireSafetyCommentForTypeAssertion as n, noObjectParameters as o, noArrayFilterMap as p, noUnvalidatedDeserialization as r, noConditionalEmptyObjectSpread as s, typescriptRulePack as t, noReduceAccumulatorCopy as u };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as createReport } from "./core-
|
|
1
|
+
import { n as createReport } from "./core-5H46uz1F.mjs";
|
|
2
2
|
import { o as defineDoctorExtension } from "./diagnostics-OWBdo3Uc.mjs";
|
|
3
|
-
import { n as shouldFailDoctorRun, t as runViteDoctor } from "./doctor-
|
|
3
|
+
import { n as shouldFailDoctorRun, t as runViteDoctor } from "./doctor-B958tLHH.mjs";
|
|
4
4
|
import { resolve } from "pathe";
|
|
5
5
|
//#region src/plugin.ts
|
|
6
6
|
function doctor(options = {}) {
|
package/dist/plugin.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as doctor } from "./plugin-
|
|
1
|
+
import { t as doctor } from "./plugin-CHGOylSB.mjs";
|
|
2
2
|
export { doctor };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as noUseNuxtAppInNitro, a as preferValidatedRouterParams, c as noBrowserApiInServer, d as preferH3RedirectResponse, f as noRemovedH3Send, g as noNavigateToInNitro, h as requireEventRuntimeConfigInServer, i as preferAssertMethod, l as noClientComposablesInServer, m as noEventRuntimeConfigInServer, n as preferGetRequestIp, o as preferValidatedQuery, p as noV2Imports, r as preferRouteMethodSuffix, s as preferValidatedBody, t as nitroRulePack, u as preferH3WithBase } from "../../rules-
|
|
2
|
-
import "../../nitro-
|
|
1
|
+
import { _ as noUseNuxtAppInNitro, a as preferValidatedRouterParams, c as noBrowserApiInServer, d as preferH3RedirectResponse, f as noRemovedH3Send, g as noNavigateToInNitro, h as requireEventRuntimeConfigInServer, i as preferAssertMethod, l as noClientComposablesInServer, m as noEventRuntimeConfigInServer, n as preferGetRequestIp, o as preferValidatedQuery, p as noV2Imports, r as preferRouteMethodSuffix, s as preferValidatedBody, t as nitroRulePack, u as preferH3WithBase } from "../../rules-Cljb26cQ.mjs";
|
|
2
|
+
import "../../nitro-EqEXN3xl.mjs";
|
|
3
3
|
export { nitroRulePack, noBrowserApiInServer, noClientComposablesInServer, noEventRuntimeConfigInServer, noNavigateToInNitro, noRemovedH3Send, noUseNuxtAppInNitro, noV2Imports, preferAssertMethod, preferGetRequestIp, preferH3RedirectResponse, preferH3WithBase, preferRouteMethodSuffix, preferValidatedBody, preferValidatedQuery, preferValidatedRouterParams, requireEventRuntimeConfigInServer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as noUseNuxtAppInNitro, a as preferValidatedRouterParams, c as noBrowserApiInServer, d as preferH3RedirectResponse, f as noRemovedH3Send, g as noNavigateToInNitro, h as requireEventRuntimeConfigInServer, i as preferAssertMethod, l as noClientComposablesInServer, m as noEventRuntimeConfigInServer, n as preferGetRequestIp, o as preferValidatedQuery, p as noV2Imports, r as preferRouteMethodSuffix, s as preferValidatedBody, t as nitroRulePack, u as preferH3WithBase } from "../../rules-
|
|
1
|
+
import { _ as noUseNuxtAppInNitro, a as preferValidatedRouterParams, c as noBrowserApiInServer, d as preferH3RedirectResponse, f as noRemovedH3Send, g as noNavigateToInNitro, h as requireEventRuntimeConfigInServer, i as preferAssertMethod, l as noClientComposablesInServer, m as noEventRuntimeConfigInServer, n as preferGetRequestIp, o as preferValidatedQuery, p as noV2Imports, r as preferRouteMethodSuffix, s as preferValidatedBody, t as nitroRulePack, u as preferH3WithBase } from "../../rules-Cljb26cQ.mjs";
|
|
2
2
|
export { nitroRulePack, noBrowserApiInServer, noClientComposablesInServer, noEventRuntimeConfigInServer, noNavigateToInNitro, noRemovedH3Send, noUseNuxtAppInNitro, noV2Imports, preferAssertMethod, preferGetRequestIp, preferH3RedirectResponse, preferH3WithBase, preferRouteMethodSuffix, preferValidatedBody, preferValidatedQuery, preferValidatedRouterParams, requireEventRuntimeConfigInServer };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as nitroRulePack } from "../../../rules-
|
|
2
|
-
import { a as nuxtImageRulePack, c as nuxtScriptsRulePack, d as nuxtRulePack, i as nuxtHubRulePack, l as nuxtUiRulePack, n as nuxtRulePacks, o as nuxtBetterAuthRulePack, r as docusRulePack, s as vueUseRulePack, t as nuxtDoctorExtensions, u as nuxtContentRulePack } from "../../../rules-
|
|
1
|
+
import { t as nitroRulePack } from "../../../rules-Cljb26cQ.mjs";
|
|
2
|
+
import { a as nuxtImageRulePack, c as nuxtScriptsRulePack, d as nuxtRulePack, i as nuxtHubRulePack, l as nuxtUiRulePack, n as nuxtRulePacks, o as nuxtBetterAuthRulePack, r as docusRulePack, s as vueUseRulePack, t as nuxtDoctorExtensions, u as nuxtContentRulePack } from "../../../rules-BVgdxeWW.mjs";
|
|
3
3
|
export { docusRulePack, nitroRulePack, nuxtBetterAuthRulePack, nuxtContentRulePack, nuxtDoctorExtensions, nuxtHubRulePack, nuxtImageRulePack, nuxtRulePack, nuxtRulePacks, nuxtScriptsRulePack, nuxtUiRulePack, vueUseRulePack };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack } from "../../index-
|
|
2
|
-
export { noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noObjectParameters, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, requireSafetyCommentForTypeAssertion, typescriptRulePack };
|
|
1
|
+
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, d as noWidenThenAssert, f as noKnownValueWidening, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, p as noArrayFilterMap, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack, u as noReduceAccumulatorCopy } from "../../index-BfWPREhz.mjs";
|
|
2
|
+
export { noArrayFilterMap, noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noKnownValueWidening, noObjectParameters, noReduceAccumulatorCopy, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, noWidenThenAssert, requireSafetyCommentForTypeAssertion, typescriptRulePack };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack } from "../../rules-
|
|
2
|
-
import "../../typescript-
|
|
3
|
-
export { noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noObjectParameters, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, requireSafetyCommentForTypeAssertion, typescriptRulePack };
|
|
1
|
+
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, d as noWidenThenAssert, f as noKnownValueWidening, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, p as noArrayFilterMap, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack, u as noReduceAccumulatorCopy } from "../../rules-BGNn6i06.mjs";
|
|
2
|
+
import "../../typescript-CkZ5kHgI.mjs";
|
|
3
|
+
export { noArrayFilterMap, noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noKnownValueWidening, noObjectParameters, noReduceAccumulatorCopy, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, noWidenThenAssert, requireSafetyCommentForTypeAssertion, typescriptRulePack };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack } from "../../../index-
|
|
2
|
-
export { typescriptRulePack as default, noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noObjectParameters, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, requireSafetyCommentForTypeAssertion };
|
|
1
|
+
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, d as noWidenThenAssert, f as noKnownValueWidening, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, p as noArrayFilterMap, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack, u as noReduceAccumulatorCopy } from "../../../index-BfWPREhz.mjs";
|
|
2
|
+
export { typescriptRulePack as default, noArrayFilterMap, noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noKnownValueWidening, noObjectParameters, noReduceAccumulatorCopy, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, noWidenThenAssert, requireSafetyCommentForTypeAssertion };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack } from "../../../rules-
|
|
2
|
-
export { typescriptRulePack as default, noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noObjectParameters, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, requireSafetyCommentForTypeAssertion };
|
|
1
|
+
import { a as noRuntimeTypeof, c as noChainedTypeAssertions, d as noWidenThenAssert, f as noKnownValueWidening, i as noUnknownTypeAliases, l as noCallerChosenResultType, n as requireSafetyCommentForTypeAssertion, o as noObjectParameters, p as noArrayFilterMap, r as noUnvalidatedDeserialization, s as noConditionalEmptyObjectSpread, t as typescriptRulePack, u as noReduceAccumulatorCopy } from "../../../rules-BGNn6i06.mjs";
|
|
2
|
+
export { typescriptRulePack as default, noArrayFilterMap, noCallerChosenResultType, noChainedTypeAssertions, noConditionalEmptyObjectSpread, noKnownValueWidening, noObjectParameters, noReduceAccumulatorCopy, noRuntimeTypeof, noUnknownTypeAliases, noUnvalidatedDeserialization, noWidenThenAssert, requireSafetyCommentForTypeAssertion };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireWorkerUrlPattern, viteRulePack };
|
|
1
|
+
import { C as noUnusedDefine, S as noUntypedDefine, _ as noEmptyEnvPrefix, a as noBroadFsAllow, b as noRuntimeObjectDefine, c as noBrowserGlobalInSsrEntry, d as requireWorkerUrlPattern, f as noDynamicNewUrl, g as noClientSecretPattern, h as noBroadEnvPrefix, i as requirePluginName, l as noDynamicWorkerUrl, m as noSrcAbsolutePublicUrl, n as preferTransformFilter, o as noDisabledFsStrict, p as noPublicSrcImport, r as requireDisposeForSideEffects, s as requireStaticGlobPattern, t as viteRulePack, u as noNodeApiInWorker, v as noUntypedEnv, x as noSecretDefine, y as preferDirectImportMetaEnvAccess } from "../../index-B7XDlLUv.mjs";
|
|
2
|
+
export { noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireStaticGlobPattern, requireWorkerUrlPattern, viteRulePack };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireWorkerUrlPattern, viteRulePack };
|
|
1
|
+
import { C as noUnusedDefine, S as noUntypedDefine, _ as noEmptyEnvPrefix, a as noBroadFsAllow, b as noRuntimeObjectDefine, c as noBrowserGlobalInSsrEntry, d as requireWorkerUrlPattern, f as noDynamicNewUrl, g as noClientSecretPattern, h as noBroadEnvPrefix, i as requirePluginName, l as noDynamicWorkerUrl, m as noSrcAbsolutePublicUrl, n as preferTransformFilter, o as noDisabledFsStrict, p as noPublicSrcImport, r as requireDisposeForSideEffects, s as requireStaticGlobPattern, t as viteRulePack, u as noNodeApiInWorker, v as noUntypedEnv, x as noSecretDefine, y as preferDirectImportMetaEnvAccess } from "../../rules-3_HzDOVa.mjs";
|
|
2
|
+
export { noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireStaticGlobPattern, requireWorkerUrlPattern, viteRulePack };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { viteRulePack as default, noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireWorkerUrlPattern };
|
|
1
|
+
import { C as noUnusedDefine, S as noUntypedDefine, _ as noEmptyEnvPrefix, a as noBroadFsAllow, b as noRuntimeObjectDefine, c as noBrowserGlobalInSsrEntry, d as requireWorkerUrlPattern, f as noDynamicNewUrl, g as noClientSecretPattern, h as noBroadEnvPrefix, i as requirePluginName, l as noDynamicWorkerUrl, m as noSrcAbsolutePublicUrl, n as preferTransformFilter, o as noDisabledFsStrict, p as noPublicSrcImport, r as requireDisposeForSideEffects, s as requireStaticGlobPattern, t as viteRulePack, u as noNodeApiInWorker, v as noUntypedEnv, x as noSecretDefine, y as preferDirectImportMetaEnvAccess } from "../../../index-B7XDlLUv.mjs";
|
|
2
|
+
export { viteRulePack as default, noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireStaticGlobPattern, requireWorkerUrlPattern };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { viteRulePack as default, noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireWorkerUrlPattern };
|
|
1
|
+
import { C as noUnusedDefine, S as noUntypedDefine, _ as noEmptyEnvPrefix, a as noBroadFsAllow, b as noRuntimeObjectDefine, c as noBrowserGlobalInSsrEntry, d as requireWorkerUrlPattern, f as noDynamicNewUrl, g as noClientSecretPattern, h as noBroadEnvPrefix, i as requirePluginName, l as noDynamicWorkerUrl, m as noSrcAbsolutePublicUrl, n as preferTransformFilter, o as noDisabledFsStrict, p as noPublicSrcImport, r as requireDisposeForSideEffects, s as requireStaticGlobPattern, t as viteRulePack, u as noNodeApiInWorker, v as noUntypedEnv, x as noSecretDefine, y as preferDirectImportMetaEnvAccess } from "../../../rules-3_HzDOVa.mjs";
|
|
2
|
+
export { viteRulePack as default, noBroadEnvPrefix, noBroadFsAllow, noBrowserGlobalInSsrEntry, noClientSecretPattern, noDisabledFsStrict, noDynamicNewUrl, noDynamicWorkerUrl, noEmptyEnvPrefix, noNodeApiInWorker, noPublicSrcImport, noRuntimeObjectDefine, noSecretDefine, noSrcAbsolutePublicUrl, noUntypedDefine, noUntypedEnv, noUnusedDefine, preferDirectImportMetaEnvAccess, preferTransformFilter, requireDisposeForSideEffects, requirePluginName, requireStaticGlobPattern, requireWorkerUrlPattern };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as htmlButtonHasType, E as definePropsWatchGetter, S as preferUseTemplateRef, T as noRefAsOperand, _ as noAsyncWatchEffectAfterAwaitRead, a as preferComposableRefReturn, b as noBrowserApiInSetup, c as preferDefineModel, d as preferUseIdForStableIds, f as requireLifecycleCleanup, g as requireWatcherCleanup, h as requirePostFlushForDomWatch, i as preferSameNamePropShorthand, l as dataAllowMismatchSurgical, m as preferUseEventListener, n as noUntranslatedText, o as preferTypeProps, p as noMutationInOnUpdated, r as noUnusedTranslations, s as preferPropsDestructureDefaults, t as vueRulePack, u as noRandomOrLocalTimeRender, v as noSetupPropsDestructure, w as noOnWatcherCleanupAfterAwait, x as preferTrueAttributeShorthand, y as restrictVHtml } from "../../rules-
|
|
1
|
+
import { C as htmlButtonHasType, E as definePropsWatchGetter, S as preferUseTemplateRef, T as noRefAsOperand, _ as noAsyncWatchEffectAfterAwaitRead, a as preferComposableRefReturn, b as noBrowserApiInSetup, c as preferDefineModel, d as preferUseIdForStableIds, f as requireLifecycleCleanup, g as requireWatcherCleanup, h as requirePostFlushForDomWatch, i as preferSameNamePropShorthand, l as dataAllowMismatchSurgical, m as preferUseEventListener, n as noUntranslatedText, o as preferTypeProps, p as noMutationInOnUpdated, r as noUnusedTranslations, s as preferPropsDestructureDefaults, t as vueRulePack, u as noRandomOrLocalTimeRender, v as noSetupPropsDestructure, w as noOnWatcherCleanupAfterAwait, x as preferTrueAttributeShorthand, y as restrictVHtml } from "../../rules-C84ec1qL.mjs";
|
|
2
2
|
export { dataAllowMismatchSurgical, definePropsWatchGetter, htmlButtonHasType, noAsyncWatchEffectAfterAwaitRead, noBrowserApiInSetup, noMutationInOnUpdated, noOnWatcherCleanupAfterAwait, noRandomOrLocalTimeRender, noRefAsOperand, noSetupPropsDestructure, noUntranslatedText, noUnusedTranslations, preferComposableRefReturn, preferDefineModel, preferPropsDestructureDefaults, preferSameNamePropShorthand, preferTrueAttributeShorthand, preferTypeProps, preferUseEventListener, preferUseIdForStableIds, preferUseTemplateRef, requireLifecycleCleanup, requirePostFlushForDomWatch, requireWatcherCleanup, restrictVHtml, vueRulePack };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as htmlButtonHasType, E as definePropsWatchGetter, S as preferUseTemplateRef, T as noRefAsOperand, _ as noAsyncWatchEffectAfterAwaitRead, a as preferComposableRefReturn, b as noBrowserApiInSetup, c as preferDefineModel, d as preferUseIdForStableIds, f as requireLifecycleCleanup, g as requireWatcherCleanup, h as requirePostFlushForDomWatch, i as preferSameNamePropShorthand, l as dataAllowMismatchSurgical, m as preferUseEventListener, n as noUntranslatedText, o as preferTypeProps, p as noMutationInOnUpdated, r as noUnusedTranslations, s as preferPropsDestructureDefaults, t as vueRulePack, u as noRandomOrLocalTimeRender, v as noSetupPropsDestructure, w as noOnWatcherCleanupAfterAwait, x as preferTrueAttributeShorthand, y as restrictVHtml } from "../../rules-
|
|
1
|
+
import { C as htmlButtonHasType, E as definePropsWatchGetter, S as preferUseTemplateRef, T as noRefAsOperand, _ as noAsyncWatchEffectAfterAwaitRead, a as preferComposableRefReturn, b as noBrowserApiInSetup, c as preferDefineModel, d as preferUseIdForStableIds, f as requireLifecycleCleanup, g as requireWatcherCleanup, h as requirePostFlushForDomWatch, i as preferSameNamePropShorthand, l as dataAllowMismatchSurgical, m as preferUseEventListener, n as noUntranslatedText, o as preferTypeProps, p as noMutationInOnUpdated, r as noUnusedTranslations, s as preferPropsDestructureDefaults, t as vueRulePack, u as noRandomOrLocalTimeRender, v as noSetupPropsDestructure, w as noOnWatcherCleanupAfterAwait, x as preferTrueAttributeShorthand, y as restrictVHtml } from "../../rules-C84ec1qL.mjs";
|
|
2
2
|
export { dataAllowMismatchSurgical, definePropsWatchGetter, htmlButtonHasType, noAsyncWatchEffectAfterAwaitRead, noBrowserApiInSetup, noMutationInOnUpdated, noOnWatcherCleanupAfterAwait, noRandomOrLocalTimeRender, noRefAsOperand, noSetupPropsDestructure, noUntranslatedText, noUnusedTranslations, preferComposableRefReturn, preferDefineModel, preferPropsDestructureDefaults, preferSameNamePropShorthand, preferTrueAttributeShorthand, preferTypeProps, preferUseEventListener, preferUseIdForStableIds, preferUseTemplateRef, requireLifecycleCleanup, requirePostFlushForDomWatch, requireWatcherCleanup, restrictVHtml, vueRulePack };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./core-
|
|
1
|
+
import "./core-5H46uz1F.mjs";
|
|
2
2
|
import { a as createRule, n as defineDoctorDiagnostics, s as defineRulePack } from "./diagnostics-OWBdo3Uc.mjs";
|
|
3
3
|
import { dirname, resolve } from "pathe";
|
|
4
4
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
@@ -88,6 +88,10 @@ const viteDiagnosticRegistry = defineDoctorDiagnostics([
|
|
|
88
88
|
{
|
|
89
89
|
code: "VITE0021",
|
|
90
90
|
ruleId: "vite/worker/require-worker-url-pattern"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
code: "VITE0022",
|
|
94
|
+
ruleId: "vite/imports/require-static-glob-pattern"
|
|
91
95
|
}
|
|
92
96
|
]);
|
|
93
97
|
const diagnostics = viteDiagnosticRegistry.diagnostics;
|
|
@@ -837,6 +841,51 @@ const browserGlobals = /* @__PURE__ */ new Set([
|
|
|
837
841
|
"navigator"
|
|
838
842
|
]);
|
|
839
843
|
//#endregion
|
|
844
|
+
//#region src/rule-packs/vite/rules/imports.ts
|
|
845
|
+
const requireStaticGlobPattern = createRule({
|
|
846
|
+
meta: {
|
|
847
|
+
id: "vite/imports/require-static-glob-pattern",
|
|
848
|
+
title: "Use literal patterns in import.meta.glob",
|
|
849
|
+
category: "imports",
|
|
850
|
+
severity: "error",
|
|
851
|
+
docsUrl: "https://vite.dev/guide/features#glob-import-caveats",
|
|
852
|
+
requires: { script: true }
|
|
853
|
+
},
|
|
854
|
+
create(ctx) {
|
|
855
|
+
return { ScriptNode(node) {
|
|
856
|
+
if (node.type !== "CallExpression") return;
|
|
857
|
+
const callee = node.callee;
|
|
858
|
+
if (callee?.type !== "MemberExpression" || callee.computed || memberPath(callee) !== "import.meta.glob") return;
|
|
859
|
+
const pattern = unwrapTypeExpression(node.arguments[0]);
|
|
860
|
+
if (isLiteralPattern(pattern)) return;
|
|
861
|
+
if (pattern?.type === "ArrayExpression" && pattern.elements.every((element) => !element || isLiteralPattern(element))) return;
|
|
862
|
+
ctx.report(diagnostics.VITE0022({
|
|
863
|
+
why: "Vite requires literal string patterns in import.meta.glob; variables and other expressions can fail the transform or leave modules out of the generated map.",
|
|
864
|
+
fix: "Pass a string literal or an array of string literals directly to import.meta.glob. For runtime selection, use a literal glob and select from the returned module map."
|
|
865
|
+
}), {
|
|
866
|
+
ruleId: "vite/imports/require-static-glob-pattern",
|
|
867
|
+
severity: ctx.severity,
|
|
868
|
+
category: "imports",
|
|
869
|
+
file: ctx.file.path,
|
|
870
|
+
range: ctx.range(pattern ?? node)
|
|
871
|
+
});
|
|
872
|
+
} };
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
function isLiteralPattern(node) {
|
|
876
|
+
return staticString(unwrapTypeExpression(node)) !== null;
|
|
877
|
+
}
|
|
878
|
+
function unwrapTypeExpression(node) {
|
|
879
|
+
while (node && [
|
|
880
|
+
"TSAsExpression",
|
|
881
|
+
"TSTypeAssertion",
|
|
882
|
+
"TSSatisfiesExpression",
|
|
883
|
+
"TSNonNullExpression",
|
|
884
|
+
"ParenthesizedExpression"
|
|
885
|
+
].includes(node.type)) node = node.expression;
|
|
886
|
+
return node;
|
|
887
|
+
}
|
|
888
|
+
//#endregion
|
|
840
889
|
//#region src/rule-packs/vite/rules/server.ts
|
|
841
890
|
const noDisabledFsStrict = createRule({
|
|
842
891
|
meta: {
|
|
@@ -1043,7 +1092,8 @@ const rules = [
|
|
|
1043
1092
|
noBroadFsAllow,
|
|
1044
1093
|
requirePluginName,
|
|
1045
1094
|
preferTransformFilter,
|
|
1046
|
-
requireDisposeForSideEffects
|
|
1095
|
+
requireDisposeForSideEffects,
|
|
1096
|
+
requireStaticGlobPattern
|
|
1047
1097
|
];
|
|
1048
1098
|
const recommended = [
|
|
1049
1099
|
noSecretDefine,
|
|
@@ -1058,7 +1108,8 @@ const recommended = [
|
|
|
1058
1108
|
noBrowserGlobalInSsrEntry,
|
|
1059
1109
|
noDisabledFsStrict,
|
|
1060
1110
|
noBroadFsAllow,
|
|
1061
|
-
requireDisposeForSideEffects
|
|
1111
|
+
requireDisposeForSideEffects,
|
|
1112
|
+
requireStaticGlobPattern
|
|
1062
1113
|
].map((rule) => rule.meta.id);
|
|
1063
1114
|
const viteRulePack = defineRulePack({
|
|
1064
1115
|
name: "vite-doctor/vite",
|
|
@@ -1070,4 +1121,4 @@ const viteRulePack = defineRulePack({
|
|
|
1070
1121
|
}
|
|
1071
1122
|
});
|
|
1072
1123
|
//#endregion
|
|
1073
|
-
export { noUnusedDefine as S,
|
|
1124
|
+
export { noUnusedDefine as C, noUntypedDefine as S, noEmptyEnvPrefix as _, noBroadFsAllow as a, noRuntimeObjectDefine as b, noBrowserGlobalInSsrEntry as c, requireWorkerUrlPattern as d, noDynamicNewUrl as f, noClientSecretPattern as g, noBroadEnvPrefix as h, requirePluginName as i, noDynamicWorkerUrl as l, noSrcAbsolutePublicUrl as m, preferTransformFilter as n, noDisabledFsStrict as o, noPublicSrcImport as p, requireDisposeForSideEffects as r, requireStaticGlobPattern as s, viteRulePack as t, noNodeApiInWorker as u, noUntypedEnv as v, noSecretDefine as x, preferDirectImportMetaEnvAccess as y };
|