summaryrefslogtreecommitdiff
path: root/tests/specs/lint/glob
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/lint/glob')
-rw-r--r--tests/specs/lint/glob/__test__.jsonc5
-rw-r--r--tests/specs/lint/glob/expected_glob.out3
-rw-r--r--tests/specs/lint/glob/with_config/a.ts4
-rw-r--r--tests/specs/lint/glob/with_config/b.ts4
-rw-r--r--tests/specs/lint/glob/without_config/file1.js2
-rw-r--r--tests/specs/lint/glob/without_config/file2.ts6
-rw-r--r--tests/specs/lint/glob/without_config/ignored_file.ts3
-rw-r--r--tests/specs/lint/glob/without_config/malformed.js4
8 files changed, 31 insertions, 0 deletions
diff --git a/tests/specs/lint/glob/__test__.jsonc b/tests/specs/lint/glob/__test__.jsonc
new file mode 100644
index 000000000..454a55804
--- /dev/null
+++ b/tests/specs/lint/glob/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "lint --ignore=without_config/malformed.js,with_config/ without_config/",
+ "output": "expected_glob.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/lint/glob/expected_glob.out b/tests/specs/lint/glob/expected_glob.out
new file mode 100644
index 000000000..eb8a2651a
--- /dev/null
+++ b/tests/specs/lint/glob/expected_glob.out
@@ -0,0 +1,3 @@
+[WILDCARD]
+Found 3 problems
+Checked 3 files
diff --git a/tests/specs/lint/glob/with_config/a.ts b/tests/specs/lint/glob/with_config/a.ts
new file mode 100644
index 000000000..c378218a3
--- /dev/null
+++ b/tests/specs/lint/glob/with_config/a.ts
@@ -0,0 +1,4 @@
+// TODO: foo
+function add(a: number, b: number): number {
+ return a + b;
+}
diff --git a/tests/specs/lint/glob/with_config/b.ts b/tests/specs/lint/glob/with_config/b.ts
new file mode 100644
index 000000000..d5647067e
--- /dev/null
+++ b/tests/specs/lint/glob/with_config/b.ts
@@ -0,0 +1,4 @@
+// TODO: this file should be ignored
+function subtract(a: number, b: number): number {
+ return a - b;
+}
diff --git a/tests/specs/lint/glob/without_config/file1.js b/tests/specs/lint/glob/without_config/file1.js
new file mode 100644
index 000000000..737f26818
--- /dev/null
+++ b/tests/specs/lint/glob/without_config/file1.js
@@ -0,0 +1,2 @@
+// deno-lint-ignore
+while (false) {}
diff --git a/tests/specs/lint/glob/without_config/file2.ts b/tests/specs/lint/glob/without_config/file2.ts
new file mode 100644
index 000000000..73c612c35
--- /dev/null
+++ b/tests/specs/lint/glob/without_config/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/glob/without_config/ignored_file.ts b/tests/specs/lint/glob/without_config/ignored_file.ts
new file mode 100644
index 000000000..97befafa3
--- /dev/null
+++ b/tests/specs/lint/glob/without_config/ignored_file.ts
@@ -0,0 +1,3 @@
+// deno-lint-ignore-file
+
+function foo(): any {}
diff --git a/tests/specs/lint/glob/without_config/malformed.js b/tests/specs/lint/glob/without_config/malformed.js
new file mode 100644
index 000000000..9b64da898
--- /dev/null
+++ b/tests/specs/lint/glob/without_config/malformed.js
@@ -0,0 +1,4 @@
+// deno-fmt-ignore-file
+
+// intentionally malformed file
+export class A B C \ No newline at end of file