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
feat: Allow linting files outside of project folder #495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but if you can add an example it would be even better!
|
||
### Can I lint files outside of the current project folder? | ||
|
||
tl;dr: Yes, but the pattern should start with `../`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add a config example here?
README.md
Outdated
|
||
By default, `lint-staged` executes linters only on the files present inside the project folder(where `lint-staged` is installed and run from). | ||
This is relevant _only_ when the project folder is a child folder inside the git repo. | ||
In certain project setups, it might be desirable to bypass this restriction so `lint-staged` provides an escape hatch for the same(`>= v7.3.0`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d drop from “so...” and connect with the next paragraph
Only when pattern starts with `../`.
0a307e9
to
af538a5
Compare
Codecov Report
@@ Coverage Diff @@
## master #495 +/- ##
==========================================
+ Coverage 97.93% 97.94% +<.01%
==========================================
Files 12 12
Lines 242 243 +1
Branches 28 29 +1
==========================================
+ Hits 237 238 +1
Misses 5 5
Continue to review full report at Codecov.
|
I created a full fledged working example and have linked to that from the readme FAQ. |
Files are not filtered only when pattern starts with
../
. This avoids adding another flag to the config and should work as expected for existing users.Closes #425.
Closes #487.
Closes #492.