-
Notifications
You must be signed in to change notification settings - Fork 192
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
Fixes #1474 - added pre-commit linter #1538
Conversation
@magsout Sorry for the late review. Had issues with my setup. I get two errors. Could you take a look please? :)
Would you also like to add the information about the pre-linter to that PR? Would be great. Otherwise I'm happy to file a follow up issue and add it. |
Yeah, I had exactly these errors. I think we should blocked the version of |
@magsout I know, you are super busy right now (FAMILY always comes FIRST 🎉) |
@zoepage sorry for the delay.. I have sent a commit for the documentation. Tell me what do you think ? |
docs/pr-coding-guidelines.md
Outdated
`npm run lint` check all JavaScript files and display the resulting errors. If you get errors, you have two possibilities. You can correct yourself or you can run `npm run fix` which use Prettier to format the code. | ||
|
||
In order to avoid errors during a Pull Request, `npm run lint` will be executed before each commit. | ||
|
||
@@something to write by miketaylr@@ |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
package.json
Outdated
"prettier": "^1.1.0", | ||
"suitcss-utils-align": "^0.2.0", | ||
"suitcss-utils-display": "^0.4.0" | ||
"prettier": "^1.1.0" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs/pr-coding-guidelines.md
Outdated
|
||
> Note: All code changes should be made to the files in `lib` | ||
|
||
#### Linting | ||
|
||
For the consistency of our codebase, we use eslint with these rules: https://github.com/webcompat/webcompat.com/blob/master/.eslintrc. We also use Prettier for formatting our code. We have set up two recipes to check and fixe the codebase. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs/pr-coding-guidelines.md
Outdated
|
||
For the consistency of our codebase, we use eslint with these rules: https://github.com/webcompat/webcompat.com/blob/master/.eslintrc. We also use Prettier for formatting our code. We have set up two recipes to check and fixe the codebase. | ||
|
||
`npm run lint` check all JavaScript files and display the resulting errors. If you get errors, you have two possibilities. You can correct yourself or you can run `npm run fix` which use Prettier to format the code. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs/pr-coding-guidelines.md
Outdated
|
||
`npm run lint` check all JavaScript files and display the resulting errors. If you get errors, you have two possibilities. You can correct yourself or you can run `npm run fix` which use Prettier to format the code. | ||
|
||
In order to avoid errors during a Pull Request, `npm run lint` will be executed before each commit. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Done @zoepage |
let me know if it's ok. I'll rebase my commits |
@magsout I'll try to check ASAP. Might take 1-2 days. Sorry! |
Hey @magsout! After that, feel free to rebase and merge! Great job! 🎉 |
docs/pr-coding-guidelines.md
Outdated
|
||
If you get an error displayed, there are two ways to fix it. | ||
1. You can run `npm run fix` automatically, which is great for small issues like missing spaces or lines in various files. | ||
2. You can correct it manually as every error message includes the file and line of the error as well as the rule which was violated. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
package.json
Outdated
"precommit": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
"{webcompat/static/js/lib, tests, grunt-tasks}/**/*.js": "lint" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
thanks a lot @zoepage for your review. ❤️ |
I just added the pre-commit part #1474 (comment)
r? @zoepage