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

feat: Allow linting files outside of project folder #495

Merged
merged 1 commit into from Sep 20, 2018

Conversation

sudo-suhas
Copy link
Collaborator

@sudo-suhas sudo-suhas commented Sep 18, 2018

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.

okonet
okonet previously approved these changes Sep 18, 2018
Copy link
Collaborator

@okonet okonet left a 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 `../`.
Copy link
Collaborator

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`).
Copy link
Collaborator

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 `../`.
@codecov
Copy link

codecov bot commented Sep 20, 2018

Codecov Report

Merging #495 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/generateTasks.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d59fad7...af538a5. Read the comment docs.

@sudo-suhas
Copy link
Collaborator Author

I created a full fledged working example and have linked to that from the readme FAQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants