diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-09-05 07:25:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 08:25:56 +0200 |
commit | acd01eb2b41e37a480943f79cfa28fc220c4baca (patch) | |
tree | a9808419bc88099fc811162d000007f6b2c30f9d /tests/integration/lsp_tests.rs | |
parent | 105c2e336a4312ed1714ab893c57eae2a19068c7 (diff) |
feat: Add a hint on error about 'Relative import path ... not prefixed with ...' (#25430)
Running a file like:
```
import "@std/dotenv/load";
```
Without a mapping in `imports` field of `deno.json` or `dependencies` of
`package.json`
will now error out with a hint:
```
error: Relative import path "@std/dotenv/load" not prefixed with / or ./ or ../
hint: Try running `deno add @std/dotenv/load`
at [WILDCARD]bare_specifier_without_import/main.ts:1:8
```
Closes https://github.com/denoland/deno/issues/24699
---------
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'tests/integration/lsp_tests.rs')
-rw-r--r-- | tests/integration/lsp_tests.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 4f0f8a985..78e526085 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -8905,7 +8905,7 @@ fn lsp_completions_node_builtin() { "severity": 1, "code": "import-node-prefix-missing", "source": "deno", - "message": "Relative import path \"fs\" not prefixed with / or ./ or ../\nIf you want to use a built-in Node module, add a \"node:\" prefix (ex. \"node:fs\").", + "message": "Relative import path \"fs\" not prefixed with / or ./ or ../\n \u{1b}[0m\u{1b}[36mhint:\u{1b}[0m If you want to use a built-in Node module, add a \"node:\" prefix (ex. \"node:fs\").", "data": { "specifier": "fs" }, |