summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/lint_tests.rs6
-rw-r--r--cli/tests/testdata/lint/Deno.no_tags.jsonc17
-rw-r--r--cli/tests/testdata/lint/with_config_without_tags.out18
-rw-r--r--cli/tests/testdata/lsp/deno.lint.jsonc9
-rw-r--r--cli/tests/testdata/lsp/types.tsconfig.json5
5 files changed, 53 insertions, 2 deletions
diff --git a/cli/tests/integration/lint_tests.rs b/cli/tests/integration/lint_tests.rs
index 4f4cf1984..3fee16aca 100644
--- a/cli/tests/integration/lint_tests.rs
+++ b/cli/tests/integration/lint_tests.rs
@@ -95,6 +95,12 @@ itest!(lint_with_config_and_flags {
exit_code: 1,
});
+itest!(lint_with_config_without_tags {
+ args: "lint --config lint/Deno.no_tags.jsonc lint/with_config/",
+ output: "lint/with_config_without_tags.out",
+ exit_code: 1,
+});
+
itest!(lint_with_malformed_config {
args: "lint --config lint/Deno.malformed.jsonc",
output: "lint/with_malformed_config.out",
diff --git a/cli/tests/testdata/lint/Deno.no_tags.jsonc b/cli/tests/testdata/lint/Deno.no_tags.jsonc
new file mode 100644
index 000000000..b86c0f8a8
--- /dev/null
+++ b/cli/tests/testdata/lint/Deno.no_tags.jsonc
@@ -0,0 +1,17 @@
+{
+ "lint": {
+ "files": {
+ "include": [
+ "lint/with_config/"
+ ],
+ "exclude": [
+ "lint/with_config/b.ts"
+ ]
+ },
+ "rules": {
+ "include": [
+ "ban-untagged-todo"
+ ]
+ }
+ }
+}
diff --git a/cli/tests/testdata/lint/with_config_without_tags.out b/cli/tests/testdata/lint/with_config_without_tags.out
new file mode 100644
index 000000000..ea4581af8
--- /dev/null
+++ b/cli/tests/testdata/lint/with_config_without_tags.out
@@ -0,0 +1,18 @@
+(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)
+// TODO: foo
+^^^^^^^^^^^^
+ at [WILDCARD]a.ts:1:0
+
+ hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
+ help: for further information visit https://lint.deno.land/#ban-untagged-todo
+
+(no-unused-vars) `add` is never used
+function add(a: number, b: number): number {
+ ^^^
+ at [WILDCARD]a.ts:2:9
+
+ hint: If this is intentional, prefix it with an underscore like `_add`
+ help: for further information visit https://lint.deno.land/#no-unused-vars
+
+Found 2 problems
+Checked 1 file
diff --git a/cli/tests/testdata/lsp/deno.lint.jsonc b/cli/tests/testdata/lsp/deno.lint.jsonc
index 51db1b5c7..03308ab5f 100644
--- a/cli/tests/testdata/lsp/deno.lint.jsonc
+++ b/cli/tests/testdata/lsp/deno.lint.jsonc
@@ -1,8 +1,13 @@
{
"lint": {
"rules": {
- "exclude": ["camelcase"],
- "include": ["ban-untagged-todo"]
+ "exclude": [
+ "camelcase"
+ ],
+ "include": [
+ "ban-untagged-todo"
+ ],
+ "tags": []
}
}
}
diff --git a/cli/tests/testdata/lsp/types.tsconfig.json b/cli/tests/testdata/lsp/types.tsconfig.json
index ba7f3344d..50de6939c 100644
--- a/cli/tests/testdata/lsp/types.tsconfig.json
+++ b/cli/tests/testdata/lsp/types.tsconfig.json
@@ -3,5 +3,10 @@
"types": [
"./a.d.ts"
]
+ },
+ "lint": {
+ "rules": {
+ "tags": []
+ }
}
}