eslint / config-inspector

A visual tool for inspecting and understanding your ESLint flat configs.
https://www.npmjs.com/package/@eslint/config-inspector
Apache License 2.0
518 stars 15 forks source link

Ability to pass in a config file path and base path #25

Closed nzakas closed 3 months ago

nzakas commented 3 months ago

Right now, the config inspector needs to be run from the same directory as eslint.config.js in order to read the file.

In the ESLint CLI, however, the config file may not be in the current working directory.

What I'd like to do is something like this:

npx @eslint/config-inspector /path/to/file.js --basePath /path/to/dir

By default, the base path is the directory that the config file is in, but if a user passes -c to the CLI with a file path, the base path is the current working directory.

With this capability, the ESLint CLI could pass the file path and, optionally, the base path to the config inspector to ensure the correct file and information is used.