mirror of
https://github.com/denoland/deno.git
synced 2025-10-03 15:44:36 +00:00
feat(cli): add ignore directives to bundled code (#13309)
This commit adds lint and fmt ignore directives to bundled code as well as a comment stating that the code was bundled and shouldn't be edited manually.
This commit is contained in:
parent
62291e9b0e
commit
50e8ab8a86
7 changed files with 44 additions and 3 deletions
13
cli/tests/testdata/compiler_api_test.ts
vendored
13
cli/tests/testdata/compiler_api_test.ts
vendored
|
@ -418,10 +418,21 @@ Deno.test({
|
|||
"/b.ts": `export const b = "b";`,
|
||||
},
|
||||
});
|
||||
const ignoreDirecives = [
|
||||
"// deno-fmt-ignore-file",
|
||||
"// deno-lint-ignore-file",
|
||||
"// This code was bundled using `deno bundle` and it's not recommended to edit it manually",
|
||||
"",
|
||||
"",
|
||||
].join("\n");
|
||||
assert(diagnostics);
|
||||
assertEquals(diagnostics.length, 0);
|
||||
assertEquals(Object.keys(files).length, 2);
|
||||
assert(files["deno:///bundle.js"].startsWith("(function() {\n"));
|
||||
assert(
|
||||
files["deno:///bundle.js"].startsWith(
|
||||
ignoreDirecives + "(function() {\n",
|
||||
),
|
||||
);
|
||||
assert(files["deno:///bundle.js"].endsWith("})();\n"));
|
||||
assert(files["deno:///bundle.js.map"]);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue