From fe8e0f2500bac5619bc3bb97a1b55c65f7365767 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Wed, 15 Oct 2025 00:57:24 +0000 Subject: [PATCH 01/14] including eslint prettier in pre-commit Signed-off-by: elliot-barn testing eslint and prettier Signed-off-by: elliot-barn updating pre commit Signed-off-by: elliot-barn new comment Signed-off-by: elliot-barn lint Signed-off-by: elliot-barn linting Signed-off-by: elliot-barn testing lint Signed-off-by: elliot-barn updating pre-commit Signed-off-by: elliot-barn testing lint Signed-off-by: elliot-barn updating file regex Signed-off-by: elliot-barn hold the door Signed-off-by: elliot-barn adding eslint to precommit array Signed-off-by: elliot-barn updating lint Signed-off-by: elliot-barn testing linter Signed-off-by: elliot-barn updating pre commit Signed-off-by: elliot-barn testing eslint Signed-off-by: elliot-barn updating pre-commit Signed-off-by: elliot-barn updating app.tsx Signed-off-by: elliot-barn updating pre commit Signed-off-by: elliot-barn updating pre commit Signed-off-by: elliot-barn adding a comment Signed-off-by: elliot-barn testing eslint Signed-off-by: elliot-barn testing es lint Signed-off-by: elliot-barn adding typescript eslint Signed-off-by: elliot-barn updating pre-commit-config Signed-off-by: elliot-barn updating empty objects Signed-off-by: elliot-barn testing Signed-off-by: elliot-barn testing Signed-off-by: elliot-barn udpating pre -commit Signed-off-by: elliot-barn testing Signed-off-by: elliot-barn updating pre commit Signed-off-by: elliot-barn testing eslint Signed-off-by: elliot-barn updating pre commit Signed-off-by: elliot-barn updating eslint Signed-off-by: elliot-barn run the test Signed-off-by: elliot-barn testing precommit Signed-off-by: elliot-barn running test Signed-off-by: elliot-barn testing eslint Signed-off-by: elliot-barn updating pre commit Signed-off-by: elliot-barn testing lint Signed-off-by: elliot-barn updating pre-commit Signed-off-by: elliot-barn updating app.tsx Signed-off-by: elliot-barn testing eslint Signed-off-by: elliot-barn testing app.tsx Signed-off-by: elliot-barn updating app.tsx Signed-off-by: elliot-barn --- .buildkite/lint.rayci.yml | 1 + .pre-commit-config.yaml | 14 ++++++++++++++ ci/lint/check-dashboard-format.sh | 8 +------- ci/lint/lint.sh | 1 + python/ray/dashboard/client/src/App.tsx | 3 +-- .../client/src/pages/exception/Loading.tsx | 2 ++ python/ray/dashboard/client/src/service/data.ts | 2 ++ python/ray/dashboard/client/src/type/raylet.d.ts | 7 +++++++ 8 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.buildkite/lint.rayci.yml b/.buildkite/lint.rayci.yml index 9762ce7a8261..c86d91e9a3be 100644 --- a/.buildkite/lint.rayci.yml +++ b/.buildkite/lint.rayci.yml @@ -23,6 +23,7 @@ steps: - pytest_format - test_coverage - documentation_style + - eslint - label: ":lint-roller: pre-commit pydoclint" key: pydoclint-small diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 378e29b3794e..f5ae7ca4a0e5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -238,3 +238,17 @@ 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.56.0 + hooks: + - id: eslint + files: ^python/ray/dashboard/client/src/.*\.[jt]sx?$ + types: [file] + additional_dependencies: + - eslint@8.56.0 + - eslint-config-google@0.14.0 + - eslint-plugin-react@7.34.2 + - '@babel/eslint-parser@7.23.3' + - '@typescript-eslint/parser@6.9.0' + - '@typescript-eslint/eslint-plugin@6.9.0' diff --git a/ci/lint/check-dashboard-format.sh b/ci/lint/check-dashboard-format.sh index 7da5d053f4c8..2ce9e1da92d0 100755 --- a/ci/lint/check-dashboard-format.sh +++ b/ci/lint/check-dashboard-format.sh @@ -3,13 +3,7 @@ set -euxo pipefail -ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE:-$0}")" || exit; pwd)/.." -WORKSPACE_DIR="${ROOT_DIR}/.." - -cd "${WORKSPACE_DIR}"/python/ray/dashboard/client || exit - +FILENAMES=("$@") 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 diff --git a/ci/lint/lint.sh b/ci/lint/lint.sh index 53d7156e86c8..24e234993a83 100755 --- a/ci/lint/lint.sh +++ b/ci/lint/lint.sh @@ -38,6 +38,7 @@ pre_commit() { cpplint buildifier buildifier-lint + eslint ) for HOOK in "${HOOKS[@]}"; do diff --git a/python/ray/dashboard/client/src/App.tsx b/python/ray/dashboard/client/src/App.tsx index 7e37d6819ca6..7faec2d478dc 100644 --- a/python/ray/dashboard/client/src/App.tsx +++ b/python/ray/dashboard/client/src/App.tsx @@ -57,13 +57,12 @@ import { import { TaskPage } from "./pages/task/TaskPage"; import { getNodeList } from "./service/node"; import { lightTheme } from "./theme"; - +//adding comment dayjs.extend(duration); // lazy loading fro prevent loading too much code at once const Actors = React.lazy(() => import("./pages/actor")); const CMDResult = React.lazy(() => import("./pages/cmd/CMDResult")); - // a global map for relations export type GlobalContextType = { nodeMap: { [key: string]: string }; diff --git a/python/ray/dashboard/client/src/pages/exception/Loading.tsx b/python/ray/dashboard/client/src/pages/exception/Loading.tsx index 15426f37c4d3..719bc6876694 100644 --- a/python/ray/dashboard/client/src/pages/exception/Loading.tsx +++ b/python/ray/dashboard/client/src/pages/exception/Loading.tsx @@ -19,3 +19,5 @@ const fn: ReactNode = ( ); export default fn; + +export const testingsssss diff --git a/python/ray/dashboard/client/src/service/data.ts b/python/ray/dashboard/client/src/service/data.ts index dfb7be1db9c3..733d2fe130e8 100644 --- a/python/ray/dashboard/client/src/service/data.ts +++ b/python/ray/dashboard/client/src/service/data.ts @@ -4,3 +4,5 @@ import { get } from "./requestHandlers"; export const getDataDatasets = (jobId: string) => { return get(`api/data/datasets/${jobId}`); }; + +export testdata = "" diff --git a/python/ray/dashboard/client/src/type/raylet.d.ts b/python/ray/dashboard/client/src/type/raylet.d.ts index b44c3b263f9b..921647c9d6e6 100644 --- a/python/ray/dashboard/client/src/type/raylet.d.ts +++ b/python/ray/dashboard/client/src/type/raylet.d.ts @@ -14,6 +14,13 @@ type LabelMap = { [key: string]: string; }; +type unused = { + +} + +type unused2 = { +}r + export type Raylet = { numWorkers: number; pid: number; From 30eb5b3f47293e18ef8105a513b005ac663b642b Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Wed, 15 Oct 2025 23:48:07 +0000 Subject: [PATCH 02/14] adding eslint to pre-commit ci runs Signed-off-by: elliot-barn --- .buildkite/lint.rayci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.buildkite/lint.rayci.yml b/.buildkite/lint.rayci.yml index c86d91e9a3be..9762ce7a8261 100644 --- a/.buildkite/lint.rayci.yml +++ b/.buildkite/lint.rayci.yml @@ -23,7 +23,6 @@ steps: - pytest_format - test_coverage - documentation_style - - eslint - label: ":lint-roller: pre-commit pydoclint" key: pydoclint-small From 4197b85ca0b54a682bcbf9760fab3e01a0ff00d0 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Wed, 15 Oct 2025 23:51:43 +0000 Subject: [PATCH 03/14] removing eslint from check dashboard format Signed-off-by: elliot-barn --- ci/lint/check-dashboard-format.sh | 9 +++++++-- python/ray/dashboard/client/src/App.tsx | 3 ++- .../ray/dashboard/client/src/pages/exception/Loading.tsx | 2 -- python/ray/dashboard/client/src/service/data.ts | 2 -- python/ray/dashboard/client/src/type/raylet.d.ts | 7 ------- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ci/lint/check-dashboard-format.sh b/ci/lint/check-dashboard-format.sh index 2ce9e1da92d0..46242e26445a 100755 --- a/ci/lint/check-dashboard-format.sh +++ b/ci/lint/check-dashboard-format.sh @@ -3,7 +3,12 @@ set -euxo pipefail -FILENAMES=("$@") +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE:-$0}")" || exit; pwd)/.." +WORKSPACE_DIR="${ROOT_DIR}/.." + +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 diff --git a/python/ray/dashboard/client/src/App.tsx b/python/ray/dashboard/client/src/App.tsx index 7faec2d478dc..7e37d6819ca6 100644 --- a/python/ray/dashboard/client/src/App.tsx +++ b/python/ray/dashboard/client/src/App.tsx @@ -57,12 +57,13 @@ import { import { TaskPage } from "./pages/task/TaskPage"; import { getNodeList } from "./service/node"; import { lightTheme } from "./theme"; -//adding comment + dayjs.extend(duration); // lazy loading fro prevent loading too much code at once const Actors = React.lazy(() => import("./pages/actor")); const CMDResult = React.lazy(() => import("./pages/cmd/CMDResult")); + // a global map for relations export type GlobalContextType = { nodeMap: { [key: string]: string }; diff --git a/python/ray/dashboard/client/src/pages/exception/Loading.tsx b/python/ray/dashboard/client/src/pages/exception/Loading.tsx index 719bc6876694..15426f37c4d3 100644 --- a/python/ray/dashboard/client/src/pages/exception/Loading.tsx +++ b/python/ray/dashboard/client/src/pages/exception/Loading.tsx @@ -19,5 +19,3 @@ const fn: ReactNode = ( ); export default fn; - -export const testingsssss diff --git a/python/ray/dashboard/client/src/service/data.ts b/python/ray/dashboard/client/src/service/data.ts index 733d2fe130e8..dfb7be1db9c3 100644 --- a/python/ray/dashboard/client/src/service/data.ts +++ b/python/ray/dashboard/client/src/service/data.ts @@ -4,5 +4,3 @@ import { get } from "./requestHandlers"; export const getDataDatasets = (jobId: string) => { return get(`api/data/datasets/${jobId}`); }; - -export testdata = "" diff --git a/python/ray/dashboard/client/src/type/raylet.d.ts b/python/ray/dashboard/client/src/type/raylet.d.ts index 921647c9d6e6..b44c3b263f9b 100644 --- a/python/ray/dashboard/client/src/type/raylet.d.ts +++ b/python/ray/dashboard/client/src/type/raylet.d.ts @@ -14,13 +14,6 @@ type LabelMap = { [key: string]: string; }; -type unused = { - -} - -type unused2 = { -}r - export type Raylet = { numWorkers: number; pid: number; From b42a3b33e897210b832a4da17306da16342cda12 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Thu, 16 Oct 2025 00:05:45 +0000 Subject: [PATCH 04/14] including max warnings flag Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f5ae7ca4a0e5..ef0fca57cc87 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -245,6 +245,8 @@ repos: - id: eslint files: ^python/ray/dashboard/client/src/.*\.[jt]sx?$ types: [file] + args: + - --max-warnings=0 additional_dependencies: - eslint@8.56.0 - eslint-config-google@0.14.0 From f993c4528f594759ea538dfe752f69d40483e0c3 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Thu, 16 Oct 2025 01:34:19 +0000 Subject: [PATCH 05/14] including eslint-plugin-import Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef0fca57cc87..ca34fa5e07eb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -251,6 +251,7 @@ repos: - eslint@8.56.0 - eslint-config-google@0.14.0 - eslint-plugin-react@7.34.2 + - eslint-plugin-import@2.29.1 - '@babel/eslint-parser@7.23.3' - '@typescript-eslint/parser@6.9.0' - '@typescript-eslint/eslint-plugin@6.9.0' From b62dec11475b87191f0b7e6df3a2d3163acb272f Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Thu, 16 Oct 2025 19:51:36 +0000 Subject: [PATCH 06/14] including react app plugin Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca34fa5e07eb..2a25e10ad199 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -252,6 +252,7 @@ repos: - eslint-config-google@0.14.0 - eslint-plugin-react@7.34.2 - eslint-plugin-import@2.29.1 + - eslint-config-react-app@7.0.1 - '@babel/eslint-parser@7.23.3' - '@typescript-eslint/parser@6.9.0' - '@typescript-eslint/eslint-plugin@6.9.0' From 77d9fcef793bb3479605fc5387b005bf2cdd9f53 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Thu, 16 Oct 2025 21:38:54 +0000 Subject: [PATCH 07/14] updating pre commit Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a25e10ad199..918341a0382c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -253,6 +253,8 @@ repos: - eslint-plugin-react@7.34.2 - eslint-plugin-import@2.29.1 - eslint-config-react-app@7.0.1 + - eslint-plugin-react-hooks@5.1.0 + - eslint-plugin-prefer-arrow@1.2.3 - '@babel/eslint-parser@7.23.3' - '@typescript-eslint/parser@6.9.0' - '@typescript-eslint/eslint-plugin@6.9.0' From 1e5d3f24e9e3cd43aa9368a3839dcab0ee13bd24 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Thu, 16 Oct 2025 22:44:22 +0000 Subject: [PATCH 08/14] updating precommit Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 918341a0382c..b1dca94cecc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -248,13 +248,9 @@ repos: args: - --max-warnings=0 additional_dependencies: - - eslint@8.56.0 - - eslint-config-google@0.14.0 - - eslint-plugin-react@7.34.2 - - eslint-plugin-import@2.29.1 + - 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-react-hooks@5.1.0 - - eslint-plugin-prefer-arrow@1.2.3 - - '@babel/eslint-parser@7.23.3' - - '@typescript-eslint/parser@6.9.0' - - '@typescript-eslint/eslint-plugin@6.9.0' + - '@typescript-eslint/parser@5.41.0' + - '@typescript-eslint/eslint-plugin@5.41.0' From 378dbbad0e335e679f7159009d4ab5b9ebe828cc Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Fri, 17 Oct 2025 20:03:22 +0000 Subject: [PATCH 09/14] testing eslint Signed-off-by: elliot-barn --- python/ray/dashboard/client/src/App.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/ray/dashboard/client/src/App.tsx b/python/ray/dashboard/client/src/App.tsx index 7e37d6819ca6..bc653d838dca 100644 --- a/python/ray/dashboard/client/src/App.tsx +++ b/python/ray/dashboard/client/src/App.tsx @@ -59,6 +59,8 @@ import { getNodeList } from "./service/node"; import { lightTheme } from "./theme"; dayjs.extend(duration); +const test; +console.log(test); // lazy loading fro prevent loading too much code at once const Actors = React.lazy(() => import("./pages/actor")); From 48c758f09f7c6c6f2990d405fb8909c500463c9e Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Fri, 17 Oct 2025 20:03:40 +0000 Subject: [PATCH 10/14] triggering eslint Signed-off-by: elliot-barn --- python/ray/dashboard/client/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ray/dashboard/client/src/App.tsx b/python/ray/dashboard/client/src/App.tsx index bc653d838dca..8d1c4ea1e25d 100644 --- a/python/ray/dashboard/client/src/App.tsx +++ b/python/ray/dashboard/client/src/App.tsx @@ -59,7 +59,7 @@ import { getNodeList } from "./service/node"; import { lightTheme } from "./theme"; dayjs.extend(duration); -const test; +const test console.log(test); // lazy loading fro prevent loading too much code at once From e621ad92c642c33562eabea6721e668954d2712c Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Fri, 17 Oct 2025 20:05:33 +0000 Subject: [PATCH 11/14] updating precommit Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1dca94cecc9..4f815fc2ad02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -243,7 +243,7 @@ repos: rev: v8.56.0 hooks: - id: eslint - files: ^python/ray/dashboard/client/src/.*\.[jt]sx?$ + files: ^python/ray/dashboard/client/src/.*\.(tsx|ts)$ types: [file] args: - --max-warnings=0 From 3ea3f02064256b7e3b95f4fc72fe3229369c14a3 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Fri, 17 Oct 2025 20:06:08 +0000 Subject: [PATCH 12/14] trigger eslint Signed-off-by: elliot-barn --- python/ray/dashboard/client/src/App.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/python/ray/dashboard/client/src/App.tsx b/python/ray/dashboard/client/src/App.tsx index 8d1c4ea1e25d..f73796241c35 100644 --- a/python/ray/dashboard/client/src/App.tsx +++ b/python/ray/dashboard/client/src/App.tsx @@ -61,7 +61,6 @@ import { lightTheme } from "./theme"; dayjs.extend(duration); const test console.log(test); - // lazy loading fro prevent loading too much code at once const Actors = React.lazy(() => import("./pages/actor")); const CMDResult = React.lazy(() => import("./pages/cmd/CMDResult")); From 5ebfec60105e023113f68fa868360f356ecc8d1b Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Fri, 17 Oct 2025 20:17:48 +0000 Subject: [PATCH 13/14] updaitng pre commit Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 9 +-------- python/ray/dashboard/client/src/App.tsx | 3 +-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f815fc2ad02..e12111fbf2a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -240,17 +240,10 @@ repos: args: ["--patch_dir", "ray/train/v2"] - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.56.0 + 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 - - '@typescript-eslint/parser@5.41.0' - - '@typescript-eslint/eslint-plugin@5.41.0' diff --git a/python/ray/dashboard/client/src/App.tsx b/python/ray/dashboard/client/src/App.tsx index f73796241c35..7e37d6819ca6 100644 --- a/python/ray/dashboard/client/src/App.tsx +++ b/python/ray/dashboard/client/src/App.tsx @@ -59,8 +59,7 @@ import { getNodeList } from "./service/node"; import { lightTheme } from "./theme"; dayjs.extend(duration); -const test -console.log(test); + // lazy loading fro prevent loading too much code at once const Actors = React.lazy(() => import("./pages/actor")); const CMDResult = React.lazy(() => import("./pages/cmd/CMDResult")); From febc2975bd1dda6c922514892b0a73302fc5274d Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Fri, 17 Oct 2025 21:15:07 +0000 Subject: [PATCH 14/14] including deps again Signed-off-by: elliot-barn --- .pre-commit-config.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e12111fbf2a7..87db886e6cd1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -247,3 +247,13 @@ repos: 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'