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

eslint rule no-document-import-in-page does not respect pageExtensions #25548

Closed
stefanprobst opened this issue May 28, 2021 · 2 comments
Closed
Assignees
Milestone

Comments

@stefanprobst
Copy link
Contributor

What version of Next.js are you using?

10.2.3

What version of Node.js are you using?

14.17.0

What browser are you using?

Firefox

What operating system are you using?

Ubuntu

How are you deploying your application?

Describe the Bug

when setting pageExtensions in next.config.js to e.g. page.tsx, the "no-document-import-in-page" rule included in eslint-plugin-next falsely warns that "next/document should not be imported outside of pages/_document.js."

Expected Behavior

eslint rule should respect pageExtensions

To Reproduce

  • create next project with yarn create next-app --typescript and enable eslint
  • add pageExtensions: ["page.tsx"] to next.config.js
  • add pages/_document.page.tsx and see error
@stefanprobst stefanprobst added the bug Issue was opened via the bug report template. label May 28, 2021
@timneutkens timneutkens added kind: bug and removed bug Issue was opened via the bug report template. labels May 28, 2021
@timneutkens timneutkens added this to the 10.x.x milestone May 28, 2021
@pacexy
Copy link
Contributor

pacexy commented Sep 2, 2021

The problem appears again in v11.1.2.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants