diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-11-10 13:40:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 18:40:39 +0000 |
commit | b78c7130e9986ce41284f33a0803ecdf6dd6affd (patch) | |
tree | 5d20148c1e7f449f9d6baa05fe6604aafc2a14b3 /cli/tests | |
parent | 882c54d5c407affb26012d81fea67cccfc214bb7 (diff) |
fix: improve `deno doc --lint` error messages (#21156)
This also updates deno_graph, which has the JSR change to use "exports".
It's not yet useful atm, so I've made this PR a fix about the deno doc
--lint error message improvements. I'll do a follow-up PR that adds
exports to the deno.json
Diffstat (limited to 'cli/tests')
12 files changed, 40 insertions, 21 deletions
diff --git a/cli/tests/integration/jsr_tests.rs b/cli/tests/integration/jsr_tests.rs index d1706d84b..11bb585a6 100644 --- a/cli/tests/integration/jsr_tests.rs +++ b/cli/tests/integration/jsr_tests.rs @@ -69,7 +69,7 @@ fn specifiers_in_lockfile() { temp_dir.write( "main.ts", - r#"import version from "jsr:@denotest/no_module_graph@0.1/mod.ts"; + r#"import version from "jsr:@denotest/no_module_graph@0.1"; console.log(version);"#, ); diff --git a/cli/tests/testdata/doc/referenced_private_types_lint.out b/cli/tests/testdata/doc/referenced_private_types_lint.out index 3b1273e22..54f225059 100644 --- a/cli/tests/testdata/doc/referenced_private_types_lint.out +++ b/cli/tests/testdata/doc/referenced_private_types_lint.out @@ -1,8 +1,8 @@ -Type 'MyClass' references type 'MyInterface' which is not exported from a root module. -Missing JS documentation comment. +Missing JSDoc comment. at file:///[WILDCARD]/referenced_private_types.ts:5:1 -Missing JS documentation comment. +Type 'MyClass.prototype.prop' references type 'MyInterface' which is not exported from a root module. +Missing JSDoc comment. at file:///[WILDCARD]/referenced_private_types.ts:6:3 -error: Found 3 documentation diagnostics. +error: Found 3 documentation lint errors. diff --git a/cli/tests/testdata/jsr/deps/main.ts b/cli/tests/testdata/jsr/deps/main.ts index 25b13a681..f48255299 100644 --- a/cli/tests/testdata/jsr/deps/main.ts +++ b/cli/tests/testdata/jsr/deps/main.ts @@ -1,3 +1,3 @@ -import value from "jsr:@denotest/deps/mod.ts"; +import value from "jsr:@denotest/deps"; console.log(value); diff --git a/cli/tests/testdata/jsr/module_graph/main.ts b/cli/tests/testdata/jsr/module_graph/main.ts index 02052595c..c92823cc2 100644 --- a/cli/tests/testdata/jsr/module_graph/main.ts +++ b/cli/tests/testdata/jsr/module_graph/main.ts @@ -1,3 +1,3 @@ -import { Test } from "jsr:@denotest/module_graph/mod.ts"; +import { Test } from "jsr:@denotest/module_graph"; console.log(new Test()); diff --git a/cli/tests/testdata/jsr/no_module_graph/main.ts b/cli/tests/testdata/jsr/no_module_graph/main.ts index ab1e781dc..6ea030c59 100644 --- a/cli/tests/testdata/jsr/no_module_graph/main.ts +++ b/cli/tests/testdata/jsr/no_module_graph/main.ts @@ -1,4 +1,4 @@ -import version, { TestClass } from "jsr:@denotest/no_module_graph@0.1.0/mod.ts"; +import version, { TestClass } from "jsr:@denotest/no_module_graph@0.1.0"; console.log(version); console.log(new TestClass()); diff --git a/cli/tests/testdata/jsr/no_module_graph/multiple.ts b/cli/tests/testdata/jsr/no_module_graph/multiple.ts index 0df32b780..660ed8be6 100644 --- a/cli/tests/testdata/jsr/no_module_graph/multiple.ts +++ b/cli/tests/testdata/jsr/no_module_graph/multiple.ts @@ -1,5 +1,5 @@ -import version1 from "jsr:@denotest/no_module_graph@0.1.0/mod.ts"; -import version2 from "jsr:@denotest/no_module_graph@^0.2/mod.ts"; +import version1 from "jsr:@denotest/no_module_graph@0.1.0"; +import version2 from "jsr:@denotest/no_module_graph@^0.2"; console.log(version1); console.log(version2); diff --git a/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts index 5b860b603..4ba0d8aaf 100644 --- a/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts +++ b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts @@ -1,5 +1,5 @@ -import { Other } from "jsr:@denotest/module_graph@1/other.ts"; -import version from "jsr:@denotest/no_module_graph@^0.1/mod.ts"; +import { Other } from "jsr:@denotest/module_graph@1/other"; +import version from "jsr:@denotest/no_module_graph@^0.1"; export default { version, diff --git a/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json index c6236b7df..f60c65026 100644 --- a/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json +++ b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json @@ -1,16 +1,19 @@ { + "exports": { + ".": "./mod.ts" + }, "moduleGraph1": { "/mod.ts": { "dependencies": [{ "kind": "import", - "range": [[0, 0], [0, 62]], - "specifier": "jsr:@denotest/module_graph@1/other.ts", - "specifierRange": [[0, 22], [0, 61]] + "range": [[0, 0], [0, 59]], + "specifier": "jsr:@denotest/module_graph@1/other", + "specifierRange": [[0, 22], [0, 58]] }, { "kind": "import", - "range": [[1, 0], [1, 64]], - "specifier": "jsr:@denotest/no_module_graph@^0.1/mod.ts", - "specifierRange": [[1, 20], [1, 63]] + "range": [[1, 0], [1, 57]], + "specifier": "jsr:@denotest/no_module_graph@^0.1", + "specifierRange": [[1, 20], [1, 56]] }] } } diff --git a/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json index d1e9a96b9..8745d72b9 100644 --- a/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json +++ b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json @@ -1,4 +1,8 @@ { + "exports": { + ".": "./mod.ts", + "./other": "./other.ts" + }, "moduleGraph1": { "/mod.ts": { "dependencies": [{ diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json index 0967ef424..631a18d0e 100644 --- a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json +++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json @@ -1 +1,5 @@ -{} +{ + "exports": { + ".": "./mod.ts" + } +} diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json index 0967ef424..631a18d0e 100644 --- a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json +++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json @@ -1 +1,5 @@ -{} +{ + "exports": { + ".": "./mod.ts" + } +} diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json index 0967ef424..631a18d0e 100644 --- a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json +++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json @@ -1 +1,5 @@ -{} +{ + "exports": { + ".": "./mod.ts" + } +} |