From f0df54fc70ec1781a3ffec232fefc38cabf39c37 Mon Sep 17 00:00:00 2001 From: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Date: Wed, 24 Jul 2024 00:17:17 +0300 Subject: fix: enable the reporting of parsing related problems when running deno lint (#24332) --- tests/specs/lint/syntax_error_reporting/__test__.jsonc | 5 +++++ tests/specs/lint/syntax_error_reporting/lint.out | 16 ++++++++++++++++ tests/specs/lint/syntax_error_reporting/script.ts | 1 + 3 files changed, 22 insertions(+) create mode 100644 tests/specs/lint/syntax_error_reporting/__test__.jsonc create mode 100644 tests/specs/lint/syntax_error_reporting/lint.out create mode 100644 tests/specs/lint/syntax_error_reporting/script.ts (limited to 'tests/specs') diff --git a/tests/specs/lint/syntax_error_reporting/__test__.jsonc b/tests/specs/lint/syntax_error_reporting/__test__.jsonc new file mode 100644 index 000000000..532caf320 --- /dev/null +++ b/tests/specs/lint/syntax_error_reporting/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "lint script.ts", + "output": "lint.out", + "exitCode": 1 +} diff --git a/tests/specs/lint/syntax_error_reporting/lint.out b/tests/specs/lint/syntax_error_reporting/lint.out new file mode 100644 index 000000000..31e4c576b --- /dev/null +++ b/tests/specs/lint/syntax_error_reporting/lint.out @@ -0,0 +1,16 @@ +warn: Unterminated string constant at [WILDCARD]script.ts:1:13 + + const foo = 'bar + ~~~~ +error[no-unused-vars]: `foo` is never used + --> [WILDCARD]script.ts:1:7 + | +1 | const foo = 'bar + | ^^^ + = hint: If this is intentional, prefix it with an underscore like `_foo` + + docs: https://lint.deno.land/rules/no-unused-vars + + +Found 1 problem +Checked 1 file diff --git a/tests/specs/lint/syntax_error_reporting/script.ts b/tests/specs/lint/syntax_error_reporting/script.ts new file mode 100644 index 000000000..4458a11ae --- /dev/null +++ b/tests/specs/lint/syntax_error_reporting/script.ts @@ -0,0 +1 @@ +const foo = 'bar -- cgit v1.2.3