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

Bug: Can't reproduce root: true behaviour in node API #18639

Closed
1 task
sahariko opened this issue Jul 1, 2024 · 4 comments
Closed
1 task

Bug: Can't reproduce root: true behaviour in node API #18639

sahariko opened this issue Jul 1, 2024 · 4 comments
Labels
bug ESLint is working incorrectly repro:needed This issue should include a reproducible example

Comments

@sahariko
Copy link

sahariko commented Jul 1, 2024

Environment

Node version: v18.12.1
npm version: v8.19.2
Local ESLint version: Not found
Global ESLint version: Not found
Operating System: darwin 22.6.0

What parser are you using?

@typescript-eslint/parser

What did you do?

When working in a repo that includes several cascading ESLint configs, you can use the root: true configuration option, and that would work great when using ESLint's CLI.

But it seems like ESLint's node API doesn't offer a compatible configuration option.

What did you expect to happen?

Node API should support the same capabilities as the CLI.

What actually happened?

Couldn't make it run.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-dppjdj?file=src/main.ts&terminal=dev

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@sahariko sahariko added bug ESLint is working incorrectly repro:needed This issue should include a reproducible example labels Jul 1, 2024
@nzakas
Copy link
Member

nzakas commented Jul 1, 2024

root: true is only available in configuration files. There is no logical equivalent in the Node.js API because the API just reads from the file system, where root: true is used.

@nzakas nzakas closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
@sahariko
Copy link
Author

sahariko commented Jul 1, 2024

Hi @nzakas, thanks for the quick response!
In my project, even though I'm using root: true in the configuration file, it doesn't seem to get picked up by node's API, am I missing something here?

@nzakas
Copy link
Member

nzakas commented Jul 1, 2024

@sahariko I have no idea because you didn't provide a reproduction case.

I will say, however, that the CLI uses the Node.js API, so it's more likely that there's a bug in your setup rather than a bug in the API.

@sahariko
Copy link
Author

sahariko commented Jul 1, 2024

@sahariko I have no idea because you didn't provide a reproduction case.

I will say, however, that the CLI uses the Node.js API, so it's more likely that there's a bug in your setup rather than a bug in the API.

Gotcha, I'll double-check and see about creating a reproduction (not so straight-forward since it's a complex proprietary project).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ESLint is working incorrectly repro:needed This issue should include a reproducible example
Projects
Archived in project
Development

No branches or pull requests

2 participants