Skip to content

Commit 2fa603f

Browse files
committed
[Feature][Engine UI] lint
1 parent 6f295fa commit 2fa603f

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

seatunnel-engine/seatunnel-engine-ui/.eslintrc.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ module.exports = {
3939
],
4040
parserOptions: {
4141
ecmaVersion: 'latest'
42+
},
43+
rules: {
44+
"vue/multi-word-component-names": "off"
4245
}
4346
}

seatunnel-engine/seatunnel-engine-ui/package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"dev": "vite",
88
"build": "run-p type-check \"build-only {@}\" --",
99
"preview": "vite preview",
10-
"test": "vitest",
10+
"test:unit": "vitest",
11+
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
12+
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
1113
"build-only": "vite build",
1214
"type-check": "vue-tsc --build --force",
1315
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
@@ -44,7 +46,9 @@
4446
"@vue/eslint-config-typescript": "^13.0.0",
4547
"@vue/test-utils": "^2.4.6",
4648
"@vue/tsconfig": "^0.5.1",
49+
"cypress": "^13.12.0",
4750
"eslint": "^8.57.0",
51+
"eslint-plugin-cypress": "^3.3.0",
4852
"eslint-plugin-vue": "^9.23.0",
4953
"jsdom": "^24.1.0",
5054
"npm-run-all2": "^6.2.0",
@@ -57,4 +61,4 @@
5761
"vitest": "^1.5.3",
5862
"vue-tsc": "^2.0.21"
5963
}
60-
}
64+
}

seatunnel-engine/seatunnel-engine-ui/src/components/configuration/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineComponent({
1212
const format = (value: any) => {
1313
value = JSON.stringify(value)
1414
if (value) {
15-
value = value.replace(/^\"(.*)\"$/, '$1')
15+
value = value.replace(/^"(.*)"$/, '$1')
1616
}
1717
return value || ''
1818
}

seatunnel-engine/seatunnel-engine-ui/src/layouts/main/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Main = defineComponent({
2525
setup() {
2626
const route = useRoute()
2727
const routeKey = ref(route.fullPath)
28-
let showSide = ref(false)
28+
const showSide = ref(false)
2929

3030
const menuKey = ref(route.meta.activeMenu as string)
3131

seatunnel-engine/seatunnel-engine-ui/src/layouts/main/sidebar/index.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ import { DesktopOutline, ListOutline, PeopleOutline, PersonOutline } from '@vico
2424
const Sidebar = defineComponent({
2525
name: 'Sidebar',
2626
props: {
27-
sideMenuOptions: {
28-
type: Array as PropType<any>,
29-
default: []
30-
},
3127
sideKey: {
3228
type: String as PropType<string>,
3329
default: ''

seatunnel-engine/seatunnel-engine-ui/src/service/service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const baseRequestConfig: AxiosRequestConfig = {
3939
const service = axios.create(baseRequestConfig)
4040

4141
const err = (err: AxiosError): Promise<AxiosError> => {
42-
if (err.response?.status === 401) {
43-
}
42+
// if (err.response?.status === 401) {
43+
// }
4444
return Promise.reject(err)
4545
}
4646

seatunnel-engine/seatunnel-engine-ui/src/utils/time.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ const { t } = i18n.global
2020
export const getRemainTime = (milliseconds: number): string => {
2121
if (!milliseconds) return ''
2222
milliseconds = milliseconds / 1000
23-
let d = parseInt(milliseconds / 60 / 60 / 24 + '')
24-
let h = parseInt(milliseconds / 60 / 60 % 24 + '')
25-
let m = parseInt(milliseconds / 60 % 60 + '')
26-
let s = parseInt(milliseconds % 60 + '')
23+
const d = parseInt(milliseconds / 60 / 60 / 24 + '')
24+
const h = parseInt(milliseconds / 60 / 60 % 24 + '')
25+
const m = parseInt(milliseconds / 60 % 60 + '')
26+
const s = parseInt(milliseconds % 60 + '')
2727
const dText = d > 0 ? `${d}${t('common.date')} ` : ''
2828
const hText = h > 0 ? `${h}${t('common.hour')} ` : ''
2929
const mText = m > 0 ? `${m}${t('common.min')} ` : ''

0 commit comments

Comments
 (0)