From ffbcad3800ef086bad791c1c640b62fd72d60172 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 21 Mar 2024 14:18:59 -0700 Subject: feat(lint): `deno lint --fix` and lsp quick fixes (#22615) Adds a `--fix` option to deno lint. This currently doesn't work for basically any rules, but we can add them over time to deno lint. --- tests/testdata/lint/expected_from_stdin.out | 2 +- tests/testdata/lint/expected_quiet.out | 4 ++-- tests/testdata/lint/with_config.out | 4 ++-- tests/testdata/lint/with_config_and_flags.out | 4 ++-- tests/testdata/lint/with_config_without_tags.out | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/testdata/lint') diff --git a/tests/testdata/lint/expected_from_stdin.out b/tests/testdata/lint/expected_from_stdin.out index 59f32166f..735b271f5 100644 --- a/tests/testdata/lint/expected_from_stdin.out +++ b/tests/testdata/lint/expected_from_stdin.out @@ -5,7 +5,7 @@ error[no-explicit-any]: `any` type is not allowed | ^^^ = hint: Use a specific type other than `any` - docs: https://lint.deno.land/#no-explicit-any + docs: https://lint.deno.land/rules/no-explicit-any Found 1 problem diff --git a/tests/testdata/lint/expected_quiet.out b/tests/testdata/lint/expected_quiet.out index e46a94a2d..91c1a29cf 100644 --- a/tests/testdata/lint/expected_quiet.out +++ b/tests/testdata/lint/expected_quiet.out @@ -5,7 +5,7 @@ error[ban-untagged-ignore]: Ignore directive requires lint rule name(s) | ^^^^^^^^^^^^^^^^^^^ = hint: Add one or more lint rule names. E.g. // deno-lint-ignore adjacent-overload-signatures - docs: https://lint.deno.land/#ban-untagged-ignore + docs: https://lint.deno.land/rules/ban-untagged-ignore error[no-empty]: Empty block statement @@ -15,6 +15,6 @@ error[no-empty]: Empty block statement | ^^ = hint: Add code or comment to the empty block - docs: https://lint.deno.land/#no-empty + docs: https://lint.deno.land/rules/no-empty diff --git a/tests/testdata/lint/with_config.out b/tests/testdata/lint/with_config.out index cffd6b9c7..f527bb712 100644 --- a/tests/testdata/lint/with_config.out +++ b/tests/testdata/lint/with_config.out @@ -5,7 +5,7 @@ error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue) | ^^^^^^^^^^^^ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123) - docs: https://lint.deno.land/#ban-untagged-todo + docs: https://lint.deno.land/rules/ban-untagged-todo error[no-unused-vars]: `add` is never used @@ -15,7 +15,7 @@ error[no-unused-vars]: `add` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_add` - docs: https://lint.deno.land/#no-unused-vars + docs: https://lint.deno.land/rules/no-unused-vars Found 2 problems diff --git a/tests/testdata/lint/with_config_and_flags.out b/tests/testdata/lint/with_config_and_flags.out index f3ad3cafb..78e21ef8d 100644 --- a/tests/testdata/lint/with_config_and_flags.out +++ b/tests/testdata/lint/with_config_and_flags.out @@ -5,7 +5,7 @@ error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123) - docs: https://lint.deno.land/#ban-untagged-todo + docs: https://lint.deno.land/rules/ban-untagged-todo error[no-unused-vars]: `subtract` is never used @@ -15,7 +15,7 @@ error[no-unused-vars]: `subtract` is never used | ^^^^^^^^ = hint: If this is intentional, prefix it with an underscore like `_subtract` - docs: https://lint.deno.land/#no-unused-vars + docs: https://lint.deno.land/rules/no-unused-vars Found 2 problems diff --git a/tests/testdata/lint/with_config_without_tags.out b/tests/testdata/lint/with_config_without_tags.out index cffd6b9c7..f527bb712 100644 --- a/tests/testdata/lint/with_config_without_tags.out +++ b/tests/testdata/lint/with_config_without_tags.out @@ -5,7 +5,7 @@ error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue) | ^^^^^^^^^^^^ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123) - docs: https://lint.deno.land/#ban-untagged-todo + docs: https://lint.deno.land/rules/ban-untagged-todo error[no-unused-vars]: `add` is never used @@ -15,7 +15,7 @@ error[no-unused-vars]: `add` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_add` - docs: https://lint.deno.land/#no-unused-vars + docs: https://lint.deno.land/rules/no-unused-vars Found 2 problems -- cgit v1.2.3