summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/lint
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-01-23 16:37:43 +0100
committerGitHub <noreply@github.com>2024-01-23 16:37:43 +0100
commit137f1a0c6836b50292c53e15aa85bd56ad14a943 (patch)
treec0bf018dbacee30ca80817ffc82751b6f9870fa0 /cli/tests/testdata/lint
parent427b73c3ec1e01ca8c670d403a85fcf31777d253 (diff)
feat(cli): improved diagnostics printing (#22049)
This initially uses the new diagnostic printer in `deno lint`, `deno doc` and `deno publish`. In the limit we should also update `deno check` to use this printer.
Diffstat (limited to 'cli/tests/testdata/lint')
-rw-r--r--cli/tests/testdata/lint/expected_from_stdin.out11
-rw-r--r--cli/tests/testdata/lint/expected_from_stdin_json.out2
-rw-r--r--cli/tests/testdata/lint/expected_quiet.out26
-rw-r--r--cli/tests/testdata/lint/watch/badly_linted.js.out4
-rw-r--r--cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out2
-rw-r--r--cli/tests/testdata/lint/with_config.out28
-rw-r--r--cli/tests/testdata/lint/with_config_and_flags.out28
-rw-r--r--cli/tests/testdata/lint/with_config_without_tags.out28
8 files changed, 78 insertions, 51 deletions
diff --git a/cli/tests/testdata/lint/expected_from_stdin.out b/cli/tests/testdata/lint/expected_from_stdin.out
index 90f455fdc..59f32166f 100644
--- a/cli/tests/testdata/lint/expected_from_stdin.out
+++ b/cli/tests/testdata/lint/expected_from_stdin.out
@@ -1,3 +1,12 @@
-[WILDCARD]
+error[no-explicit-any]: `any` type is not allowed
+ --> [WILDCARD]$deno$stdin.ts:1:9
+ |
+1 | let _a: any;
+ | ^^^
+ = hint: Use a specific type other than `any`
+
+ docs: https://lint.deno.land/#no-explicit-any
+
+
Found 1 problem
Checked 1 file
diff --git a/cli/tests/testdata/lint/expected_from_stdin_json.out b/cli/tests/testdata/lint/expected_from_stdin_json.out
index 7ea40e957..26bf7ddc7 100644
--- a/cli/tests/testdata/lint/expected_from_stdin_json.out
+++ b/cli/tests/testdata/lint/expected_from_stdin_json.out
@@ -13,7 +13,7 @@
"bytePos": 11
}
},
- "filename": "_stdin.ts",
+ "filename": "[WILDCARD]$deno$stdin.ts",
"message": "`any` type is not allowed",
"code": "no-explicit-any",
"hint": [WILDCARD]
diff --git a/cli/tests/testdata/lint/expected_quiet.out b/cli/tests/testdata/lint/expected_quiet.out
index 7a2ef48e6..e46a94a2d 100644
--- a/cli/tests/testdata/lint/expected_quiet.out
+++ b/cli/tests/testdata/lint/expected_quiet.out
@@ -1,14 +1,20 @@
-(ban-untagged-ignore) Ignore directive requires lint rule name(s)
-// deno-lint-ignore
-^^^^^^^^^^^^^^^^^^^
- at [WILDCARD]file1.js:1:1
+error[ban-untagged-ignore]: Ignore directive requires lint rule name(s)
+ --> [WILDCARD]file1.js:1:1
+ |
+1 | // deno-lint-ignore
+ | ^^^^^^^^^^^^^^^^^^^
+ = hint: Add one or more lint rule names. E.g. // deno-lint-ignore adjacent-overload-signatures
- hint: [WILDCARD]
+ docs: https://lint.deno.land/#ban-untagged-ignore
-(no-empty) Empty block statement
-while (false) {}
- ^^
- at [WILDCARD]file1.js:2:15
- hint: [WILDCARD]
+error[no-empty]: Empty block statement
+ --> [WILDCARD]file1.js:2:15
+ |
+2 | while (false) {}
+ | ^^
+ = hint: Add code or comment to the empty block
+
+ docs: https://lint.deno.land/#no-empty
+
diff --git a/cli/tests/testdata/lint/watch/badly_linted.js.out b/cli/tests/testdata/lint/watch/badly_linted.js.out
index 5c715695a..07ae031c3 100644
--- a/cli/tests/testdata/lint/watch/badly_linted.js.out
+++ b/cli/tests/testdata/lint/watch/badly_linted.js.out
@@ -1,2 +1,2 @@
-(no-unused-vars) `a` is never used
-(prefer-const) `a` is never reassigned
+error[no-unused-vars]: `a` is never used
+error[prefer-const]: `a` is never reassigned
diff --git a/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out b/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out
index fe74a7a2c..67e3c9dd8 100644
--- a/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out
+++ b/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out
@@ -1 +1 @@
-(prefer-const) `_a` is never reassigned
+error[prefer-const]: `_a` is never reassigned
diff --git a/cli/tests/testdata/lint/with_config.out b/cli/tests/testdata/lint/with_config.out
index 2ea821c05..cffd6b9c7 100644
--- a/cli/tests/testdata/lint/with_config.out
+++ b/cli/tests/testdata/lint/with_config.out
@@ -1,18 +1,22 @@
-(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)
-// TODO: foo
-^^^^^^^^^^^^
- at [WILDCARD]a.ts:1:1
+error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue)
+ --> [WILDCARD]a.ts:1:1
+ |
+1 | // TODO: foo
+ | ^^^^^^^^^^^^
+ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- help: for further information visit https://lint.deno.land/#ban-untagged-todo
+ docs: https://lint.deno.land/#ban-untagged-todo
-(no-unused-vars) `add` is never used
-function add(a: number, b: number): number {
- ^^^
- at [WILDCARD]a.ts:2:10
- hint: If this is intentional, prefix it with an underscore like `_add`
- help: for further information visit https://lint.deno.land/#no-unused-vars
+error[no-unused-vars]: `add` is never used
+ --> [WILDCARD]a.ts:2:10
+ |
+2 | function add(a: number, b: number): number {
+ | ^^^
+ = hint: If this is intentional, prefix it with an underscore like `_add`
+
+ docs: https://lint.deno.land/#no-unused-vars
+
Found 2 problems
Checked 1 file
diff --git a/cli/tests/testdata/lint/with_config_and_flags.out b/cli/tests/testdata/lint/with_config_and_flags.out
index 41432df9d..f3ad3cafb 100644
--- a/cli/tests/testdata/lint/with_config_and_flags.out
+++ b/cli/tests/testdata/lint/with_config_and_flags.out
@@ -1,18 +1,22 @@
-(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)
-// TODO: this file should be ignored
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- at [WILDCARD]b.ts:1:1
+error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue)
+ --> [WILDCARD]b.ts:1:1
+ |
+1 | // TODO: this file should be ignored
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- help: for further information visit https://lint.deno.land/#ban-untagged-todo
+ docs: https://lint.deno.land/#ban-untagged-todo
-(no-unused-vars) `subtract` is never used
-function subtract(a: number, b: number): number {
- ^^^^^^^^
- at [WILDCARD]b.ts:2:10
- hint: If this is intentional, prefix it with an underscore like `_subtract`
- help: for further information visit https://lint.deno.land/#no-unused-vars
+error[no-unused-vars]: `subtract` is never used
+ --> [WILDCARD]b.ts:2:10
+ |
+2 | function subtract(a: number, b: number): number {
+ | ^^^^^^^^
+ = hint: If this is intentional, prefix it with an underscore like `_subtract`
+
+ docs: https://lint.deno.land/#no-unused-vars
+
Found 2 problems
Checked 1 file
diff --git a/cli/tests/testdata/lint/with_config_without_tags.out b/cli/tests/testdata/lint/with_config_without_tags.out
index 2ea821c05..cffd6b9c7 100644
--- a/cli/tests/testdata/lint/with_config_without_tags.out
+++ b/cli/tests/testdata/lint/with_config_without_tags.out
@@ -1,18 +1,22 @@
-(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)
-// TODO: foo
-^^^^^^^^^^^^
- at [WILDCARD]a.ts:1:1
+error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue)
+ --> [WILDCARD]a.ts:1:1
+ |
+1 | // TODO: foo
+ | ^^^^^^^^^^^^
+ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- help: for further information visit https://lint.deno.land/#ban-untagged-todo
+ docs: https://lint.deno.land/#ban-untagged-todo
-(no-unused-vars) `add` is never used
-function add(a: number, b: number): number {
- ^^^
- at [WILDCARD]a.ts:2:10
- hint: If this is intentional, prefix it with an underscore like `_add`
- help: for further information visit https://lint.deno.land/#no-unused-vars
+error[no-unused-vars]: `add` is never used
+ --> [WILDCARD]a.ts:2:10
+ |
+2 | function add(a: number, b: number): number {
+ | ^^^
+ = hint: If this is intentional, prefix it with an underscore like `_add`
+
+ docs: https://lint.deno.land/#no-unused-vars
+
Found 2 problems
Checked 1 file