-
-
Notifications
You must be signed in to change notification settings - Fork 485
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 noDocumentImportInPage
rule
#4265
Conversation
CodSpeed Performance ReportMerging #4265 will not alter performanceComparing Summary
|
|
||
fn diagnostic(ctx: &RuleContext<Self>, _: &Self::State) -> Option<RuleDiagnostic> { | ||
return Some( | ||
RuleDiagnostic::new( |
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.
You might want to explain the users why this error occurs ( See Rule pllars in this case.
In eslint-plugin-next/no-document-import-in-page, they are not explaining why the error is triggered but providing the link Why This Error Occurred.
We could add an explanation IMHO.
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.
The explanation in their link is pretty vague 😅
"to avoid unexpected behaviors" was the best I could extract from it.
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.
Yeah, Next.js documentation is usually bad 😔
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 agree
crates/biome_js_analyze/src/lint/nursery/no_document_import_in_page.rs
Outdated
Show resolved
Hide resolved
I left a suggestion but looks good to me. |
…_page.rs Co-authored-by: unvalley <38400669+unvalley@users.noreply.github.com>
@kaioduarte could you update the CHANGELOG.md? |
@unvalley done, I included my other PRs as well |
Co-authored-by: unvalley <38400669+unvalley@users.noreply.github.com>
Summary
Implement no-document-import-in-page from eslint-plugin-next.
Test Plan
Snapshots + CI