-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fe8e0f2
including eslint prettier in pre-commit
elliot-barn 30eb5b3
adding eslint to pre-commit ci runs
elliot-barn 4197b85
removing eslint from check dashboard format
elliot-barn b42a3b3
including max warnings flag
elliot-barn f993c45
including eslint-plugin-import
elliot-barn b62dec1
including react app plugin
elliot-barn 77d9fce
updating pre commit
elliot-barn 1e5d3f2
updating precommit
elliot-barn 378dbba
testing eslint
elliot-barn 48c758f
triggering eslint
elliot-barn e621ad9
updating precommit
elliot-barn 3ea3f02
trigger eslint
elliot-barn 5ebfec6
updaitng pre commit
elliot-barn febc297
including deps again
elliot-barn 39dba59
Merge branch 'master' into elliot-barn/lintupdates
elliot-barn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -244,3 +244,22 @@ repos: | |
| files: '^python/ray/train/.*\.py$' | ||
| pass_filenames: false | ||
| args: ["--patch_dir", "ray/train/v2"] | ||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-eslint | ||
| rev: v8.26.0 | ||
| hooks: | ||
| - id: eslint | ||
| files: ^python/ray/dashboard/client/src/.*\.(tsx|ts)$ | ||
| types: [file] | ||
| args: | ||
| - --max-warnings=0 | ||
| additional_dependencies: | ||
| - eslint@8.26.0 | ||
| - eslint-plugin-react@7.31.10 | ||
| - eslint-plugin-import@2.26.0 | ||
| - eslint-config-react-app@7.0.1 | ||
| - eslint-plugin-prefer-arrow@1.2.3 | ||
| - '@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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ pre_commit() { | |
| cpplint | ||
| buildifier | ||
| buildifier-lint | ||
| eslint | ||
| ) | ||
|
|
||
| for HOOK in "${HOOKS[@]}"; do | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Bug: Pre-commit Hook Isolation Causes ESLint Configuration Issues
The new pre-commit
eslinthook runs in an isolated environment, preventing it from accessing the dashboard client's project-specificeslintconfigurations and plugins installed bynpm ci. This can causeeslintto fail or behave inconsistently.Additional Locations (1)
ci/lint/check-dashboard-format.sh#L11-L12