Skip to content
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

Merged
merged 3 commits into from
Oct 13, 2024

Conversation

kaioduarte
Copy link
Contributor

Summary

Implement no-document-import-in-page from eslint-plugin-next.

Test Plan

Snapshots + CI

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Oct 12, 2024
Copy link

codspeed-hq bot commented Oct 12, 2024

CodSpeed Performance Report

Merging #4265 will not alter performance

Comparing kaioduarte:no-document-import-in-page (d82e847) with main (4d3e6cd)

Summary

✅ 105 untouched benchmarks


fn diagnostic(ctx: &RuleContext<Self>, _: &Self::State) -> Option<RuleDiagnostic> {
return Some(
RuleDiagnostic::new(
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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 😔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

@unvalley
Copy link
Member

I left a suggestion but looks good to me.

…_page.rs

Co-authored-by: unvalley <38400669+unvalley@users.noreply.github.com>
@unvalley
Copy link
Member

@kaioduarte could you update the CHANGELOG.md?

@github-actions github-actions bot added the A-Changelog Area: changelog label Oct 13, 2024
@kaioduarte
Copy link
Contributor Author

@unvalley done, I included my other PRs as well

@unvalley unvalley merged commit 2342984 into biomejs:main Oct 13, 2024
12 checks passed
@kaioduarte kaioduarte deleted the no-document-import-in-page branch October 15, 2024 09:24
Conaclos pushed a commit that referenced this pull request Oct 18, 2024
Co-authored-by: unvalley <38400669+unvalley@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants