From 77c1694383a59f17a77535fb6c8d9cd77a30e582 Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Wed, 14 Jun 2023 09:35:35 +0800 Subject: [PATCH] build: check component types (#283) --- .github/workflows/nodejs.yml | 1 + package.json | 3 ++- .../dashboard/related/task-timeline/components/Timeline.vue | 4 ---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 9c731c21..3003504b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -49,6 +49,7 @@ jobs: npm ci npm run lint npm run build --if-present + npm run check-components-types npm run test:unit env: CI: true diff --git a/package.json b/package.json index 35fcf0fc..bd873a2e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"", "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", "lint:lint-staged": "lint-staged", - "prepare": "husky install" + "prepare": "husky install", + "check-components-types": "if (! git diff --quiet -U0 ./src/types); then echo 'type files are not updated correctly'; git diff -U0 ./src/types; exit 1; fi" }, "dependencies": { "axios": "^0.24.0", diff --git a/src/views/dashboard/related/task-timeline/components/Timeline.vue b/src/views/dashboard/related/task-timeline/components/Timeline.vue index 208586fa..7ccf984f 100644 --- a/src/views/dashboard/related/task-timeline/components/Timeline.vue +++ b/src/views/dashboard/related/task-timeline/components/Timeline.vue @@ -128,10 +128,6 @@ limitations under the License. --> }); } - function getURI(uri: { uriRegex: string; uriPath: string }) { - return uri && uri.uriRegex && uri.uriPath ? `(${uri.uriRegex || ""} | ${uri.uriPath || ""})` : ""; - } - function resize() { const observer = new ResizeObserver((entries) => { const entry = entries[0];