next.js
next.js copied to clipboard
False positive `no-html-link-for-pages` ESLint rule triggered
I got an eslint error (no-html-link-for-pages):
Pages directory cannot be found at ~/Projects/HypeProxy.io/v3/application/pages or ~/Projects/HypeProxy.io/v3/application/src/pages. If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.
Originally posted by @thisisclint21 in https://github.com/vercel/next.js/discussions/41745#discussioncomment-4046328
Reproduction:
git clone https://github.com/balazsorban44/nextjs-42448
pnpm i && pnpm lint
Note: After the first run, the result is saved in .next/cache/eslint and won't show the message again. To reproduce again, remove the .next/cache/eslint folder.
Hey! I'd like to take this issue.
Feel free!
To make sure: if experimental app directory is enabled via configuration, we want to skip checking pages and check only app?
To make sure: if experimental
appdirectory is enabled via configuration, we want to skip checkingpagesand check onlyapp?
Both appDir and pages can exist at the same time (this is for incremental adoption). So the ESLint should lint both app and pages.
Oh yeah, forgot about this detail. I guess we need to lint appDir only in case it's enabled in this case.
Hmm, from what I see enabling linting for appDir might be a bit more complicated because it introduces new app structure. Do we want to include it in the scope of this issue or it should be handled separately? I can disable this warning if there's appDir, and we can work on linting for appDir in another issue. What do you think?
Also maybe think about the futur /api folder if it will exists :D
Hmm, from what I see enabling linting for
appDirmight be a bit more complicated because it introduces new app structure. Do we want to include it in the scope of this issue or it should be handled separately? I can disable this warning if there'sappDir, and we can work on linting forappDirin another issue. What do you think?
Let's split this into 2 PRs. In the first PR, you can disable the warning if app exists (do not detect config.experimental.appDir as the option will be removed in the future).
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.