-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add node:
specifier rule
#1306
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I think though that we should add it to cli/tools/lint/rules in the deno repo instead so that we can keep the node built-in modules in sync with the cli?
#[derive(Debug)] | ||
pub struct NodeBuiltinsSpecifier; | ||
|
||
const CODE: &str = "node-builtin-specifier"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe require-node-prefix
or require-node-scheme
or something like that?
Err... sure, didn't know that it was possible to add lint rules directly to the deno codebase. I'll try porting it. +1 I like the |
Another option is making this rule accept a list of built-in node modules that we can provide in the CLI, then we can construct this rule in the CLI's list of rules. |
@marvinhagemeister can you move it to the |
This PR adds a rule that warns when the
node:
specifier is missing when trying to import a built-in node module.Invalid:
Valid:
Related denoland/deno#24930