diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-06-10 23:29:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 23:29:48 +0200 |
commit | e4e332abbbe0dbdb44305a261f9965ba89e7767b (patch) | |
tree | 6bdbeb2c6d1039adf34f7366e467e105e91ab63d /cli/tests | |
parent | e53a1b14968099df06624a4dc4d4ab810d1ce443 (diff) |
feat(lint): use default globs, upgrade to v0.1.9 (#6222)
This commit:
* added default file globs so "deno lint" can be run
without arguments (just like "deno fmt")
* added test for globs in "deno lint"
* upgrade "deno_lint" crate to v0.1.9
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration_tests.rs | 6 | ||||
-rw-r--r-- | cli/tests/lint/expected.out | 26 | ||||
-rw-r--r-- | cli/tests/lint/expected_glob.out | 2 | ||||
-rw-r--r-- | cli/tests/lint/file1.js | 5 | ||||
-rw-r--r-- | cli/tests/lint/file2.ts | 3 | ||||
-rw-r--r-- | cli/tests/std_lint.out | 3 |
6 files changed, 21 insertions, 24 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index fafce3eb0..e3f4bd085 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1957,6 +1957,12 @@ itest!(deno_lint { exit_code: 1, }); +itest!(deno_lint_glob { + args: "lint --unstable lint/", + output: "lint/expected_glob.out", + exit_code: 1, +}); + #[test] fn cafile_fetch() { use url::Url; diff --git a/cli/tests/lint/expected.out b/cli/tests/lint/expected.out index 0b0654298..57af15971 100644 --- a/cli/tests/lint/expected.out +++ b/cli/tests/lint/expected.out @@ -1,12 +1,12 @@ -(no-var) `var` keyword is not allowed -var a = 1, -~~~~~~~~~~ +(ban-untagged-ignore) Ignore directive requires lint rule code +// deno-lint-ignore +~~~~~~~~~~~~~~~~~~~ at [WILDCARD]file1.js:1:0 -(single-var-declarator) Multiple variable declarators are not allowed -var a = 1, -~~~~~~~~~~ - at [WILDCARD]file1.js:1:0 +(no-empty) Empty block statement +while (false) {} + ~~ + at [WILDCARD]file1.js:2:14 (no-empty) Empty block statement } catch (e) {} @@ -23,14 +23,4 @@ function foo(): any {} ~~~~~~~~~~~~~~~~~~~~~~ at [WILDCARD]file2.ts:6:0 -(ban-untagged-ignore) Ignore directive requires lint rule code -// deno-lint-ignore -~~~~~~~~~~~~~~~~~~~ - at [WILDCARD]file2.ts:8:0 - -(no-empty) Empty block statement -while (false) {} - ~~ - at [WILDCARD]file2.ts:9:14 - -Found 7 problems +Found 5 problems diff --git a/cli/tests/lint/expected_glob.out b/cli/tests/lint/expected_glob.out new file mode 100644 index 000000000..3e3ebd649 --- /dev/null +++ b/cli/tests/lint/expected_glob.out @@ -0,0 +1,2 @@ +[WILDCARD] +Found 5 problems diff --git a/cli/tests/lint/file1.js b/cli/tests/lint/file1.js index d74b6f47a..737f26818 100644 --- a/cli/tests/lint/file1.js +++ b/cli/tests/lint/file1.js @@ -1,3 +1,2 @@ -var a = 1, - b = 2, - c = 3; +// deno-lint-ignore +while (false) {} diff --git a/cli/tests/lint/file2.ts b/cli/tests/lint/file2.ts index f0f3a3ba3..10c709ba2 100644 --- a/cli/tests/lint/file2.ts +++ b/cli/tests/lint/file2.ts @@ -4,6 +4,3 @@ try { // deno-lint-ignore no-explicit-any require-await function foo(): any {} - -// deno-lint-ignore -while (false) {} diff --git a/cli/tests/std_lint.out b/cli/tests/std_lint.out new file mode 100644 index 000000000..9d62fcc67 --- /dev/null +++ b/cli/tests/std_lint.out @@ -0,0 +1,3 @@ +[WILDCARD] + +Found [WILDCARD] problems
\ No newline at end of file |