From 78774dd6647aef137b83473ab86c2f0f1a427e86 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 7 Jun 2024 13:02:47 -0400 Subject: fix: do not panic linting files with UTF-8 BOM (#24136) Closes #24122 --- tests/specs/lint/bom/__test__.jsonc | 5 +++++ tests/specs/lint/bom/mod.out | 12 ++++++++++++ tests/specs/lint/bom/mod.ts | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 tests/specs/lint/bom/__test__.jsonc create mode 100644 tests/specs/lint/bom/mod.out create mode 100644 tests/specs/lint/bom/mod.ts (limited to 'tests') diff --git a/tests/specs/lint/bom/__test__.jsonc b/tests/specs/lint/bom/__test__.jsonc new file mode 100644 index 000000000..f2ea579c4 --- /dev/null +++ b/tests/specs/lint/bom/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "lint mod.ts", + "exitCode": 1, + "output": "mod.out" +} diff --git a/tests/specs/lint/bom/mod.out b/tests/specs/lint/bom/mod.out new file mode 100644 index 000000000..eea1e531d --- /dev/null +++ b/tests/specs/lint/bom/mod.out @@ -0,0 +1,12 @@ +error[no-unused-vars]: `t` is never used + --> [WILDLINE] + | +4 | const t = 5; + | ^ + = hint: If this is intentional, prefix it with an underscore like `_t` + + docs: https://lint.deno.land/rules/no-unused-vars + + +Found 1 problem +Checked 1 file diff --git a/tests/specs/lint/bom/mod.ts b/tests/specs/lint/bom/mod.ts new file mode 100644 index 000000000..c2374d45d --- /dev/null +++ b/tests/specs/lint/bom/mod.ts @@ -0,0 +1,4 @@ +// this file is saved as UTF8 with BOM +console.log("Hello, world!"); + +const t = 5; -- cgit v1.2.3