-
Notifications
You must be signed in to change notification settings - Fork 7k
[ci] including eslint in pre-commit #57721
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
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.
Code Review
This pull request adds a pre-commit hook to run eslint and prettier on the dashboard client code. While this is a good step towards automated formatting checks, the current implementation of the hook has several performance and correctness issues. I've left a comment with suggestions to improve the hook's efficiency and fix its file matching. The main concerns are that the hook runs npm ci on every commit and lints all files instead of just the changed ones, which will be very slow.
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing eslint and prettier Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> new comment Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> lint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> linting Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing lint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre-commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing lint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating file regex Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> hold the door Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> adding eslint to precommit array Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating lint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing linter Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing eslint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre-commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating app.tsx Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> adding a comment Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing eslint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing es lint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> adding typescript eslint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre-commit-config Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating empty objects Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> udpating pre -commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing eslint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating eslint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> run the test Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing precommit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> running test Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing eslint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing lint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating pre-commit Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating app.tsx Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing eslint Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> testing app.tsx Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> updating app.tsx Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
79442c9 to
4197b85
Compare
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
|
cc @alanwguo |
aslonnie
left a comment
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 that the new lint is failing on CI.
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
alanwguo
left a comment
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.
nice
| - '@typescript-eslint/parser@5.41.0' | ||
| - '@typescript-eslint/eslint-plugin@5.41.0' | ||
| - '@typescript-eslint/parser@5.41.0' | ||
| - '@typescript-eslint/eslint-plugin@5.41.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.
adding eslint and prettier script to precommit before getting rid of format.sh 1 step closer to replacing scripts/format.sh with pre-commit (pre-commit is currently missing eslint) tested locally: <img width="898" height="929" alt="image" src="https://github.com/user-attachments/assets/58c77fb7-bdde-47ae-ac2b-b864334b3f30" /> --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
adding eslint and prettier script to precommit before getting rid of format.sh 1 step closer to replacing scripts/format.sh with pre-commit (pre-commit is currently missing eslint) tested locally: <img width="898" height="929" alt="image" src="https://github.com/user-attachments/assets/58c77fb7-bdde-47ae-ac2b-b864334b3f30" /> --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Signed-off-by: xgui <xgui@anyscale.com>
adding eslint and prettier script to precommit before getting rid of format.sh 1 step closer to replacing scripts/format.sh with pre-commit (pre-commit is currently missing eslint) tested locally: <img width="898" height="929" alt="image" src="https://github.com/user-attachments/assets/58c77fb7-bdde-47ae-ac2b-b864334b3f30" /> --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
adding eslint and prettier script to precommit before getting rid of format.sh 1 step closer to replacing scripts/format.sh with pre-commit (pre-commit is currently missing eslint) tested locally: <img width="898" height="929" alt="image" src="https://github.com/user-attachments/assets/58c77fb7-bdde-47ae-ac2b-b864334b3f30" /> --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
adding eslint and prettier script to precommit before getting rid of format.sh 1 step closer to replacing scripts/format.sh with pre-commit (pre-commit is currently missing eslint) tested locally: <img width="898" height="929" alt="image" src="https://github.com/user-attachments/assets/58c77fb7-bdde-47ae-ac2b-b864334b3f30" /> --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
adding eslint and prettier script to precommit before getting rid of format.sh
1 step closer to replacing scripts/format.sh with pre-commit (pre-commit is currently missing eslint)
tested locally:
