next.js icon indicating copy to clipboard operation
next.js copied to clipboard

False positive `no-html-link-for-pages` ESLint rule triggered

Open balazsorban44 opened this issue 3 years ago • 8 comments

  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.

balazsorban44 avatar Nov 03 '22 21:11 balazsorban44

Hey! I'd like to take this issue.

mrkldshv avatar Nov 03 '22 23:11 mrkldshv

Feel free!

balazsorban44 avatar Nov 04 '22 03:11 balazsorban44

To make sure: if experimental app directory is enabled via configuration, we want to skip checking pages and check only app?

mrkldshv avatar Nov 04 '22 14:11 mrkldshv

To make sure: if experimental app directory is enabled via configuration, we want to skip checking pages and check only app?

Both appDir and pages can exist at the same time (this is for incremental adoption). So the ESLint should lint both app and pages.

SukkaW avatar Nov 04 '22 16:11 SukkaW

Oh yeah, forgot about this detail. I guess we need to lint appDir only in case it's enabled in this case.

mrkldshv avatar Nov 04 '22 17:11 mrkldshv

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?

mrkldshv avatar Nov 04 '22 18:11 mrkldshv

Also maybe think about the futur /api folder if it will exists :D

imclint21 avatar Nov 05 '22 13:11 imclint21

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?

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).

SukkaW avatar Nov 05 '22 15:11 SukkaW

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.

github-actions[bot] avatar Apr 21 '23 12:04 github-actions[bot]