forked from denoland/deno
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(check): allow using side effect imports with unknown module kind…
…s (ex. css modules) (denoland#23392) This allows people to use imports like: ```ts import "./app.css"; ``` ...with `deno check` in systems where there's a bundle step (ex. Vite). This will still error when using it with `deno run` or if the referenced file does not exist. See test cases for behaviour.
- Loading branch information
1 parent
af1825f
commit 9be6709
Showing
13 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"steps": [{ | ||
"args": "check exists.ts", | ||
"output": "exists.out" | ||
}, { | ||
"args": "run --check exists.ts", | ||
"output": "exists_run_with_check.out", | ||
"exitCode": 1 | ||
}, { | ||
"args": "check not_exists.ts", | ||
"output": "not_exists.out", | ||
"exitCode": 1 | ||
}, { | ||
"args": "check exists_and_try_uses.ts", | ||
"output": "exists_and_try_uses.out", | ||
"exitCode": 1 | ||
}, { | ||
"args": "check exists_dynamic_import.ts", | ||
"output": "Check file:///[WILDCARD]exists_dynamic_import.ts\n" | ||
}, { | ||
"args": "run --check --reload exists_dynamic_import.ts", | ||
"output": "Check file:///[WILDCARD]exists_dynamic_import.ts\n" | ||
}] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Check [WILDLINE]exists.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// should not error for deno check | ||
import "./app.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Check file:///[WILDLINE]/exists_and_try_uses.ts | ||
error: TS1192 [ERROR]: Module '"file:///[WILDLINE]/app.css"' has no default export. | ||
import test from "./app.css"; | ||
~~~~ | ||
at file:///[WILDLINE]/exists_and_try_uses.ts:1:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import test from "./app.css"; | ||
|
||
test(123); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if (false) { | ||
await import("./app.css"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported. | ||
Specifier: file:///[WILDLINE]/app.css | ||
at file:///[WILDLINE]/exists.ts:2:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
error: Module not found "file:///[WILDLINE]/not_exists.css". | ||
at file:///[WILDLINE]/not_exists.ts:1:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./not_exists.css"; |