-
-
Notifications
You must be signed in to change notification settings - Fork 495
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(lint): add noUnwantedPolyfillio
#4731
base: next
Are you sure you want to change the base?
Conversation
bd144d1
to
91c936b
Compare
CodSpeed Performance ReportMerging #4731 will not alter performanceComparing Summary
|
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.
Nice!
crates/biome_js_analyze/src/lint/nursery/no_unwanted_polyfillio.rs
Outdated
Show resolved
Hide resolved
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.
I would appreciate if you could point this PR to next
. The majority of new code and features are there. We recently started changing how the analyzer works, and we added the domains. Among domains, we have a "next"
domain, and this rule should be added to that.
use biome_js_syntax::JsImport; | ||
use biome_rowan::AstNode; | ||
|
||
/// Represent Next.js libraries. |
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.
Can you explain what "next libraries" means? The implementation shows a next/script
, which isn't a library. It's a specifier of the next
package, however this comment seems misleading, because I understood external libraries.
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.
sorry you are right, how about call them "Next.js built-in utility(utilities)"? I would like to point to next/image
, next/link
etc.
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.
That's definitely better! Good suggestion
de9fa96
to
f0feb37
Compare
refactor: clippy warnings refactor: clippy warnings
af49062
to
e59429c
Compare
pub NoUnwantedPolyfillio { | ||
version: "next", | ||
name: "noUnwantedPolyfillio", | ||
language: "jsx", | ||
sources: &[RuleSource::EslintNext("no-unwanted-polyfillio")], | ||
source_kind: RuleSourceKind::SameLogic, | ||
recommended: false, | ||
} |
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.
In case you missed the new features, here the domains.
For this rule, we should assign the RuleDomain::Next
. And recommend the rule.
Also, we should assign a proper severity. I leave it to you based on your knowledge.
Plus, we should add a changeset.
Apologies for letting you change things again. Things have been changing a lot :)
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.
Summary
Implement no-unwanted-polyfillio from eslint-plugin-next.
Test Plan
Add snapshot tests