Skip to content

Commit 5b426c7

Browse files
authored
[ci] including eslint in pre-commit (#57721)
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>
1 parent 33d0a32 commit 5b426c7

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,22 @@ repos:
244244
files: '^python/ray/train/.*\.py$'
245245
pass_filenames: false
246246
args: ["--patch_dir", "ray/train/v2"]
247+
248+
- repo: https://github.com/pre-commit/mirrors-eslint
249+
rev: v8.26.0
250+
hooks:
251+
- id: eslint
252+
files: ^python/ray/dashboard/client/src/.*\.(tsx|ts)$
253+
types: [file]
254+
args:
255+
- --max-warnings=0
256+
additional_dependencies:
257+
- eslint@8.26.0
258+
- eslint-plugin-react@7.31.10
259+
- eslint-plugin-import@2.26.0
260+
- eslint-config-react-app@7.0.1
261+
- eslint-plugin-prefer-arrow@1.2.3
262+
- '@typescript-eslint/parser@5.41.0'
263+
- '@typescript-eslint/eslint-plugin@5.41.0'
264+
- '@typescript-eslint/parser@5.41.0'
265+
- '@typescript-eslint/eslint-plugin@5.41.0'

ci/lint/check-dashboard-format.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ cd "${WORKSPACE_DIR}"/python/ray/dashboard/client || exit
1010

1111
npm ci
1212
FILENAMES=($(find src -name "*.ts" -or -name "*.tsx"))
13-
node_modules/.bin/eslint --max-warnings 0 "${FILENAMES[@]}"
1413
node_modules/.bin/prettier --check "${FILENAMES[@]}"
1514
node_modules/.bin/prettier --check public/index.html

ci/lint/lint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pre_commit() {
3838
cpplint
3939
buildifier
4040
buildifier-lint
41+
eslint
4142
)
4243

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

0 commit comments

Comments
 (0)