diff options
| author | souldzin <4908127+souldzin@users.noreply.github.com> | 2020-08-13 10:30:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-13 17:30:46 +0200 |
| commit | d6cee706955f300086f41f9318d23631f64f036b (patch) | |
| tree | 61ff94128f1f4a03af2574a488d04301bbfcf3f7 /cli/tests/lint | |
| parent | 08ab4d46ca1860da16b5250fe3872cefbe682637 (diff) | |
feat: Add "--json" flag to deno lint (#6940)
Co-authored-by: JackSkylark <jdslaughter44@gmail.com>
Diffstat (limited to 'cli/tests/lint')
| -rw-r--r-- | cli/tests/lint/expected_ignore.out | 2 | ||||
| -rw-r--r-- | cli/tests/lint/expected_json.out | 43 | ||||
| -rw-r--r-- | cli/tests/lint/malformed.js | 4 |
3 files changed, 48 insertions, 1 deletions
diff --git a/cli/tests/lint/expected_ignore.out b/cli/tests/lint/expected_ignore.out index 6041d1c6a..02b9d917c 100644 --- a/cli/tests/lint/expected_ignore.out +++ b/cli/tests/lint/expected_ignore.out @@ -1,2 +1,2 @@ [WILDCARD] -Found 1 problems +Found 1 problem diff --git a/cli/tests/lint/expected_json.out b/cli/tests/lint/expected_json.out new file mode 100644 index 000000000..b4ce63395 --- /dev/null +++ b/cli/tests/lint/expected_json.out @@ -0,0 +1,43 @@ +{ + "diagnostics": [ + { + "location": { + "filename": "[WILDCARD]", + "line": 1, + "col": 0 + }, + "message": "Ignore directive requires lint rule code", + "code": "ban-untagged-ignore", + "line_src": "// deno-lint-ignore", + "snippet_length": 19 + }, + { + "location": { + "filename": "[WILDCARD]", + "line": 2, + "col": 14 + }, + "message": "Empty block statement", + "code": "no-empty", + "line_src": "while (false) {}", + "snippet_length": 2 + }, + { + "location": { + "filename": "[WILDCARD]", + "line": 3, + "col": 12 + }, + "message": "Empty block statement", + "code": "no-empty", + "line_src": "} catch (e) {}", + "snippet_length": 2 + } + ], + "errors": [ + { + "file_path": "[WILDCARD]malformed.js", + "message": "Expected RBrace, got None at [WILDCARD]malformed.js:4:15" + } + ] +} diff --git a/cli/tests/lint/malformed.js b/cli/tests/lint/malformed.js new file mode 100644 index 000000000..5ad4650d6 --- /dev/null +++ b/cli/tests/lint/malformed.js @@ -0,0 +1,4 @@ +// deno-fmt-ignore-file + +// intentionally malformed file +export class A {
\ No newline at end of file |
