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
Chore: Add .pre-commit-hooks.yaml file #13628
Conversation
I'm not against adding this if it doesn't require any additional maintenance, though it feels like an inverse of responsibilities to me to put the onus on the other projects to include this definition rather than the project that will be consuming it. |
I understand you, close the pull if you don't feel comfortable with the file. It's only useful for the programmers that want to use the master of eslint in their hooks, but we can always settle for the mirror that uses pre-commit. |
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.
Seems like a small enough change without any overhead, so okay by me.
Do we need to include this file in the published package on npm, or does this check the repo somehow? |
Only checks the repo, |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:
Add
.pre-commit-hooks.yaml
file to make work Eslint hooks whit pre-commit framework.This allows users to configure a file in their project named
.pre-commit-config.yaml
with a content like, for example, this:...and every commit that users would attempt in their project will run two hooks to check Javascript files against Eslint. If any of the hooks fails, the commit will be aborted. The interesting part is that only files with changes will be linted.
See markdownlint-cli, flake8 or yamllint as other examples of linters that have been added the file without efforts.
Is there anything you'd like reviewers to focus on?
It's something that doesn't need maintainment, so you wouldn't need focus on.