summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-27 21:35:08 -0400
committerGitHub <noreply@github.com>2024-05-28 01:35:08 +0000
commitc4211e2ffceaa01ebeeab0a3b16809dd8e08667b (patch)
treeed36ad2b75717ed814493d4fba0d0730b6f9e48a /tests/specs
parent328bd8acce70ec1e928405a16eac6732eef38067 (diff)
fix(publish): raise diagnostics for triple-slash directives for `--dry-run` instead of just `publish` (#23811)
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/publish/banned_triple_slash_directives/__test__.jsonc5
-rw-r--r--tests/specs/publish/banned_triple_slash_directives/deno.json5
-rw-r--r--tests/specs/publish/banned_triple_slash_directives/mod.ts2
-rw-r--r--tests/specs/publish/banned_triple_slash_directives/publish.out26
4 files changed, 38 insertions, 0 deletions
diff --git a/tests/specs/publish/banned_triple_slash_directives/__test__.jsonc b/tests/specs/publish/banned_triple_slash_directives/__test__.jsonc
new file mode 100644
index 000000000..06a91f5b6
--- /dev/null
+++ b/tests/specs/publish/banned_triple_slash_directives/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "publish --dry-run",
+ "output": "publish.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/publish/banned_triple_slash_directives/deno.json b/tests/specs/publish/banned_triple_slash_directives/deno.json
new file mode 100644
index 000000000..fe4300ad6
--- /dev/null
+++ b/tests/specs/publish/banned_triple_slash_directives/deno.json
@@ -0,0 +1,5 @@
+{
+ "name": "@scope/pkg",
+ "version": "1.0.0",
+ "exports": "./mod.ts"
+}
diff --git a/tests/specs/publish/banned_triple_slash_directives/mod.ts b/tests/specs/publish/banned_triple_slash_directives/mod.ts
new file mode 100644
index 000000000..a5bd87ef7
--- /dev/null
+++ b/tests/specs/publish/banned_triple_slash_directives/mod.ts
@@ -0,0 +1,2 @@
+/// <reference lib="deno.ns" />
+/// <reference no-default-lib="true" />
diff --git a/tests/specs/publish/banned_triple_slash_directives/publish.out b/tests/specs/publish/banned_triple_slash_directives/publish.out
new file mode 100644
index 000000000..a67736bc2
--- /dev/null
+++ b/tests/specs/publish/banned_triple_slash_directives/publish.out
@@ -0,0 +1,26 @@
+Check file:///[WILDLINE]/mod.ts
+Checking for slow types in the public API...
+Check file:///[WILDLINE]/mod.ts
+error[banned-triple-slash-directives]: triple slash directives that modify globals are not allowed
+ --> [WILDLINE]mod.ts:1:1
+ |
+1 | /// <reference lib="deno.ns" />
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the triple slash directive
+ = hint: remove the triple slash directive
+
+ info: instead instruct the user of your package to specify these directives
+ info: or set their 'lib' compiler option appropriately
+ docs: https://jsr.io/go/banned-triple-slash-directives
+
+error[banned-triple-slash-directives]: triple slash directives that modify globals are not allowed
+ --> [WILDLINE]:2:1
+ |
+2 | /// <reference no-default-lib="true" />
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the triple slash directive
+ = hint: remove the triple slash directive
+
+ info: instead instruct the user of your package to specify these directives
+ info: or set their 'lib' compiler option appropriately
+ docs: https://jsr.io/go/banned-triple-slash-directives
+
+error: Found 2 problems