This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
feat: add setting to select current working directory indicator file #1368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the current working directory is determined by the location of .eslintignore by default. I think rational behind this makes sense, but it would be a nice feature to have that configurable. I currently do not use .eslintignore but have my project is in a sub folder. This means linter-eslint selects the project root as the current working directory which breaks webpack import linting on my Vue.js projects.
After searching through a few of issues here, in vue cli, and other projects it looks like this is a fairly common point of confusion and use case. Adding this setting would be a convenient feature and i think a lot of users when they discover the cwd is not what they expect might go searching in settings. It would be nice to have something there to indicate how the cwd is selected.
I added the setting to the uncommon section so it doesn't clutter more frequently used settings. If unspecified (default) it should revert to the original behavior. I thought it would be nice to make the default ".eslintignore" or something to indicate what it does currently, but there are a number of fall backs so I decided to keep it totally decoupled from the current behavior.