Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

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 eslint hook runs in an isolated environment, preventing it from accessing the dashboard client's project-specific eslint configurations and plugins installed by npm ci. This can cause eslint to fail or behave inconsistently.

Additional Locations (1)

Fix in Cursor Fix in Web

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'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Duplicate ESLint Dependencies in Pre-commit Hook

The eslint pre-commit hook's additional_dependencies list contains duplicate entries for @typescript-eslint/parser and @typescript-eslint/eslint-plugin, which appears to be a copy-paste error.

Fix in Cursor Fix in Web

1 change: 0 additions & 1 deletion ci/lint/check-dashboard-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ cd "${WORKSPACE_DIR}"/python/ray/dashboard/client || exit

npm ci
FILENAMES=($(find src -name "*.ts" -or -name "*.tsx"))
node_modules/.bin/eslint --max-warnings 0 "${FILENAMES[@]}"
node_modules/.bin/prettier --check "${FILENAMES[@]}"
node_modules/.bin/prettier --check public/index.html
1 change: 1 addition & 0 deletions ci/lint/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pre_commit() {
cpplint
buildifier
buildifier-lint
eslint
)

for HOOK in "${HOOKS[@]}"; do
Expand Down