Skip to content

no-html-link-for-pages eslint rule uses cwd instead of project directory #26330

@brandonchinn178

Description

@brandonchinn178

What version of Next.js are you using?

11.0.1-canary.4

What version of Node.js are you using?

14.15.5

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

vercel

Describe the Bug

I have a project with separate directories for client and server (my project has two servers: nextjs and graphql), with the path client/next.config.js. Running eslint from the root directory using the next eslint plugin shows

Pages directory cannot be found at <repo>/pages or <repo>/src/pages. If using a custom path, please configure with the no-html-link-for-pages rule in your eslint config file

This happens whether I add the plugin in the top-level .eslintrc or in the client/.eslintrc

Expected Behavior

Rule should look for pages directory in the same directory as next.config.js (or some other marker of a NextJS project). Alternatively, rule should look for pages directory in the same directory as the .eslintrc file it's added in.

To Reproduce

Create a NextJS project in a subdirectory and run linting from the parent directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions