no-unversioned-import
NOTE: this rule is part of the
recommended rule set.Enable full set in
deno.json:{
"lint": {
"rules": {
"tags": ["recommended"]
}
}
}Enable full set using the Deno CLI:
deno lint --rules-tags=recommended
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the
include or exclude array in deno.json:{
"lint": {
"rules": {
"include": ["no-unversioned-import"],
"exclude": ["no-unversioned-import"]
}
}
}Ensure that inline dependency imports have a version specifier.
Invalid: Jump to heading
import foo from "npm:chalk";
import foo from "jsr:@std/path";
Valid: Jump to heading
import foo from "npm:chalk@5.3.0";
import foo from "npm:chalk@^5.3.0";
import foo from "jsr:@std/path@1.0.8";
import foo from "jsr:@std/path@^1.0.8";