Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Revert unix style warning #4173

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/compiler/src/config/config-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ function validatePathAbsolute(
target: target === NoTarget ? target : getLocationInYamlScript(target.file, target.path),
});
}
if (path.includes("\\")) {
return createDiagnostic({
code: "path-unix-style",
format: { path },
target: target === NoTarget ? target : getLocationInYamlScript(target.file, target.path),
});
}
// if (path.includes("\\")) {
// return createDiagnostic({
// code: "path-unix-style",
// format: { path },
// target: target === NoTarget ? target : getLocationInYamlScript(target.file, target.path),
// });
// }

return undefined;
}
25 changes: 8 additions & 17 deletions packages/compiler/src/core/schema-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function absolutePathStatus(path: string): "valid" | "not-absolute" | "windows-s
if (path.startsWith(".") || !isPathAbsolute(path)) {
return "not-absolute";
}
if (path.includes("\\")) {
return "windows-style";
}
// if (path.includes("\\")) {
// return "windows-style";
// }
return "valid";
}

Expand Down Expand Up @@ -75,20 +75,11 @@ function ajvErrorToDiagnostic(
const tspTarget = resolveTarget(error, target);
if (error.params.format === "absolute-path") {
const value = getErrorValue(obj, error) as any;
const status = absolutePathStatus(value);
if (status === "windows-style") {
return createDiagnostic({
code: "path-unix-style",
format: { path: value },
target: tspTarget,
});
} else {
return createDiagnostic({
code: "config-path-absolute",
format: { path: value },
target: tspTarget,
});
}
return createDiagnostic({
code: "config-path-absolute",
format: { path: value },
target: tspTarget,
});
}

const messageLines = [`Schema violation: ${error.message} (${error.instancePath || "/"})`];
Expand Down
3 changes: 2 additions & 1 deletion packages/compiler/test/core/emitter-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ describe("compiler: emitter options", () => {
});
});

it("emit diagnostic if passing windows style path", async () => {
// This was disabled
it.skip("emit diagnostic if passing windows style path", async () => {
const diagnostics = await diagnoseEmitterOptions({
"asset-dir": "C:\\abc\\def",
});
Expand Down
Loading