summaryrefslogtreecommitdiff
path: root/tests/specs/lint
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/lint')
-rw-r--r--tests/specs/lint/gitignore/.gitignore1
-rw-r--r--tests/specs/lint/gitignore/__test__.jsonc5
-rw-r--r--tests/specs/lint/gitignore/dist/file1.js3
-rw-r--r--tests/specs/lint/gitignore/expected.out12
-rw-r--r--tests/specs/lint/gitignore/file2.ts6
-rw-r--r--tests/specs/lint/node_globals_no_duplicate_imports/main.out4
6 files changed, 31 insertions, 0 deletions
diff --git a/tests/specs/lint/gitignore/.gitignore b/tests/specs/lint/gitignore/.gitignore
new file mode 100644
index 000000000..838458f20
--- /dev/null
+++ b/tests/specs/lint/gitignore/.gitignore
@@ -0,0 +1 @@
+/dist/ \ No newline at end of file
diff --git a/tests/specs/lint/gitignore/__test__.jsonc b/tests/specs/lint/gitignore/__test__.jsonc
new file mode 100644
index 000000000..e777fb1c1
--- /dev/null
+++ b/tests/specs/lint/gitignore/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "lint",
+ "output": "expected.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/lint/gitignore/dist/file1.js b/tests/specs/lint/gitignore/dist/file1.js
new file mode 100644
index 000000000..669c1e2c8
--- /dev/null
+++ b/tests/specs/lint/gitignore/dist/file1.js
@@ -0,0 +1,3 @@
+// This file is in `.gitignore` simulating that it's generated by a build tool
+// and should not be linted
+while (false) {}
diff --git a/tests/specs/lint/gitignore/expected.out b/tests/specs/lint/gitignore/expected.out
new file mode 100644
index 000000000..8024b51d1
--- /dev/null
+++ b/tests/specs/lint/gitignore/expected.out
@@ -0,0 +1,12 @@
+error[no-empty]: Empty block statement
+ --> [WILDCARD]file2.ts:3:14
+ |
+3 | } catch (_e) {}
+ | ^^
+ = hint: Add code or comment to the empty block
+
+ docs: https://lint.deno.land/rules/no-empty
+
+
+Found 1 problem
+Checked 1 file
diff --git a/tests/specs/lint/gitignore/file2.ts b/tests/specs/lint/gitignore/file2.ts
new file mode 100644
index 000000000..73c612c35
--- /dev/null
+++ b/tests/specs/lint/gitignore/file2.ts
@@ -0,0 +1,6 @@
+try {
+ await Deno.open("./some/file.txt");
+} catch (_e) {}
+
+// deno-lint-ignore no-explicit-any
+function _foo(): any {}
diff --git a/tests/specs/lint/node_globals_no_duplicate_imports/main.out b/tests/specs/lint/node_globals_no_duplicate_imports/main.out
index 56df10eba..ce5523f99 100644
--- a/tests/specs/lint/node_globals_no_duplicate_imports/main.out
+++ b/tests/specs/lint/node_globals_no_duplicate_imports/main.out
@@ -2,3 +2,7 @@ error: Uncaught (in promise) ReferenceError: setImmediate is not defined
const _foo = setImmediate;
^
at [WILDCARD]main.ts:3:14
+
+ info: setImmediate is not available in the global scope in Deno.
+ hint: Import it explicitly with import { setImmediate } from "node:timers";,
+ or run again with --unstable-node-globals flag to add this global.