Skip to content

Server side workingDirectory.mode auto detection is incomplete #2077

@kapral18

Description

@kapral18

Context

projectFolderIndicators are pretty comprehensive

But they make an implicit assumption about package.json being a root of a project. This is not always the case. In fact it's rarely the case without accompanying lock files. Lock-files are a better indicator of a project root than the package.json itself.

A lot of projects are using a structure where project.json is a subroot/package/plugin root whereas from non-flat config eslint perspective root level .eslintrc.js file is still the root that those subroot projects use.

A few famous examples:

https://github.com/remix-run/react-router/blob/main/packages/react-router/package.json
https://github.com/elastic/kibana/blob/main/packages/kbn-dependency-usage/package.json
https://github.com/facebook/react/blob/main/packages/react-art/package.json

Problem

When using workingDirectory: { mode = "auto" } in server settings, in aforementioned projects eslintServer changes CWD to nearest package.json folder which breaks projects like above with nested .eslintrc.js

Solution

Use package manager lock files as indicators instead of package.json

Opened a PR: #2076

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions