diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-21 14:18:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-21 14:18:59 -0700 |
commit | ffbcad3800ef086bad791c1c640b62fd72d60172 (patch) | |
tree | f350a54862928e19ba93a75b71a4c4bebcc974f3 /tests/specs | |
parent | 2166aa8fb6be5fdd6d607db587e236de11b6fb91 (diff) |
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.
Diffstat (limited to 'tests/specs')
-rw-r--r-- | tests/specs/lint/lint_fix/__test__.jsonc | 17 | ||||
-rw-r--r-- | tests/specs/lint/lint_fix/a.ts | 4 | ||||
-rw-r--r-- | tests/specs/lint/lint_fix/a_fixed.out | 4 | ||||
-rw-r--r-- | tests/specs/lint/lint_fix/lint.out | 2 | ||||
-rw-r--r-- | tests/specs/lint/lint_fix/lint_fixed.out | 1 |
5 files changed, 28 insertions, 0 deletions
diff --git a/tests/specs/lint/lint_fix/__test__.jsonc b/tests/specs/lint/lint_fix/__test__.jsonc new file mode 100644 index 000000000..53736586f --- /dev/null +++ b/tests/specs/lint/lint_fix/__test__.jsonc @@ -0,0 +1,17 @@ +{ + "tempDir": true, + "steps": [{ + "args": "lint --rules-tags=recommended,jsr", + "output": "lint.out", + "exitCode": 1 + }, { + "args": "lint --fix --rules-tags=recommended,jsr", + "output": "lint_fixed.out" + }, { + "args": "lint --rules-tags=recommended,jsr", + "output": "lint_fixed.out" + }, { + "args": "run --allow-read --quiet http://localhost:4545/cat.ts a.ts", + "output": "a_fixed.out" + }] +} diff --git a/tests/specs/lint/lint_fix/a.ts b/tests/specs/lint/lint_fix/a.ts new file mode 100644 index 000000000..6a1b87bc4 --- /dev/null +++ b/tests/specs/lint/lint_fix/a.ts @@ -0,0 +1,4 @@ +import { Type } from "./test.ts"; +export type MyType = Type; +console.log(window.value); +window.fetch; diff --git a/tests/specs/lint/lint_fix/a_fixed.out b/tests/specs/lint/lint_fix/a_fixed.out new file mode 100644 index 000000000..5193be18e --- /dev/null +++ b/tests/specs/lint/lint_fix/a_fixed.out @@ -0,0 +1,4 @@ +import type { Type } from "./test.ts"; +export type MyType = Type; +console.log(globalThis.value); +globalThis.fetch; diff --git a/tests/specs/lint/lint_fix/lint.out b/tests/specs/lint/lint_fix/lint.out new file mode 100644 index 000000000..e292c2881 --- /dev/null +++ b/tests/specs/lint/lint_fix/lint.out @@ -0,0 +1,2 @@ +[WILDCARD]Found 4 problems (4 fixable via --fix) +Checked 1 file diff --git a/tests/specs/lint/lint_fix/lint_fixed.out b/tests/specs/lint/lint_fix/lint_fixed.out new file mode 100644 index 000000000..c05ac45a1 --- /dev/null +++ b/tests/specs/lint/lint_fix/lint_fixed.out @@ -0,0 +1 @@ +Checked 1 file |