summaryrefslogtreecommitdiff
path: root/tests/specs/lint/with_config_and_flags
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/lint/with_config_and_flags')
-rw-r--r--tests/specs/lint/with_config_and_flags/Deno.jsonc10
-rw-r--r--tests/specs/lint/with_config_and_flags/__test__.jsonc5
-rw-r--r--tests/specs/lint/with_config_and_flags/with_config/a.ts4
-rw-r--r--tests/specs/lint/with_config_and_flags/with_config/b.ts4
-rw-r--r--tests/specs/lint/with_config_and_flags/with_config_and_flags.out22
5 files changed, 45 insertions, 0 deletions
diff --git a/tests/specs/lint/with_config_and_flags/Deno.jsonc b/tests/specs/lint/with_config_and_flags/Deno.jsonc
new file mode 100644
index 000000000..e9c03cca4
--- /dev/null
+++ b/tests/specs/lint/with_config_and_flags/Deno.jsonc
@@ -0,0 +1,10 @@
+{
+ "lint": {
+ "include": ["with_config/"],
+ "exclude": ["with_config/b.ts"],
+ "rules": {
+ "tags": ["recommended"],
+ "include": ["ban-untagged-todo"]
+ }
+ }
+}
diff --git a/tests/specs/lint/with_config_and_flags/__test__.jsonc b/tests/specs/lint/with_config_and_flags/__test__.jsonc
new file mode 100644
index 000000000..926d1983b
--- /dev/null
+++ b/tests/specs/lint/with_config_and_flags/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "lint --config Deno.jsonc --ignore=with_config/a.ts",
+ "output": "with_config_and_flags.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/lint/with_config_and_flags/with_config/a.ts b/tests/specs/lint/with_config_and_flags/with_config/a.ts
new file mode 100644
index 000000000..c378218a3
--- /dev/null
+++ b/tests/specs/lint/with_config_and_flags/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/with_config_and_flags/with_config/b.ts b/tests/specs/lint/with_config_and_flags/with_config/b.ts
new file mode 100644
index 000000000..d5647067e
--- /dev/null
+++ b/tests/specs/lint/with_config_and_flags/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/with_config_and_flags/with_config_and_flags.out b/tests/specs/lint/with_config_and_flags/with_config_and_flags.out
new file mode 100644
index 000000000..78e21ef8d
--- /dev/null
+++ b/tests/specs/lint/with_config_and_flags/with_config_and_flags.out
@@ -0,0 +1,22 @@
+error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue)
+ --> [WILDCARD]b.ts:1:1
+ |
+1 | // TODO: this file should be ignored
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
+
+ docs: https://lint.deno.land/rules/ban-untagged-todo
+
+
+error[no-unused-vars]: `subtract` is never used
+ --> [WILDCARD]b.ts:2:10
+ |
+2 | function subtract(a: number, b: number): number {
+ | ^^^^^^^^
+ = hint: If this is intentional, prefix it with an underscore like `_subtract`
+
+ docs: https://lint.deno.land/rules/no-unused-vars
+
+
+Found 2 problems
+Checked 1 file