From 50e8ab8a8630a272e9862f2fb7014107474405c6 Mon Sep 17 00:00:00 2001 From: juju Date: Wed, 12 Jan 2022 20:05:06 +0800 Subject: 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. --- cli/tests/testdata/compiler_api_test.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cli/tests/testdata/compiler_api_test.ts') diff --git a/cli/tests/testdata/compiler_api_test.ts b/cli/tests/testdata/compiler_api_test.ts index 30fc19d5f..41378f941 100644 --- a/cli/tests/testdata/compiler_api_test.ts +++ b/cli/tests/testdata/compiler_api_test.ts @@ -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"]); }, -- cgit v1.2.3