Skip to content

Commit 5be1b14

Browse files
authored
Merge pull request #184 from timi137137/feat/timi137137
chore: 将模板代码向TS对齐
2 parents 2216de7 + da81c24 commit 5be1b14

21 files changed

Lines changed: 77 additions & 33 deletions

File tree

.eslintrc

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,24 @@
4444
"import/first": "off", // https://github.com/vuejs/vue-eslint-parser/issues/58
4545
"@typescript-eslint/no-explicit-any": "off",
4646
"@typescript-eslint/explicit-module-boundary-types": "off",
47-
"vue/first-attribute-linebreak": 0
47+
"vue/first-attribute-linebreak": 0,
48+
49+
"@typescript-eslint/no-unused-vars": [
50+
"error",
51+
{
52+
"argsIgnorePattern": "^_",
53+
"varsIgnorePattern": "^_"
54+
}
55+
],
56+
"no-unused-vars": [
57+
"error",
58+
{
59+
"argsIgnorePattern": "^_",
60+
"varsIgnorePattern": "^_"
61+
}
62+
],
63+
"@typescript-eslint/ban-ts-comment": "off",
64+
"@typescript-eslint/ban-types": "off"
4865
},
4966
"overrides": [
5067
{
@@ -57,6 +74,32 @@
5774
"vue/no-v-html": 0,
5875
"vue-scoped-css/enforce-style-type": ["error", { "allows": ["scoped"] }]
5976
}
77+
},
78+
{
79+
"files": ["*.ts", "*.tsx"], // https://github.com/typescript-eslint eslint-recommended
80+
"rules": {
81+
"constructor-super": "off", // ts(2335) & ts(2377)
82+
"getter-return": "off", // ts(2378)
83+
"no-const-assign": "off", // ts(2588)
84+
"no-dupe-args": "off", // ts(2300)
85+
"no-dupe-class-members": "off", // ts(2393) & ts(2300)
86+
"no-dupe-keys": "off", // ts(1117)
87+
"no-func-assign": "off", // ts(2539)
88+
"no-import-assign": "off", // ts(2539) & ts(2540)
89+
"no-new-symbol": "off", // ts(2588)
90+
"no-obj-calls": "off", // ts(2349)
91+
"no-redeclare": "off", // ts(2451)
92+
"no-setter-return": "off", // ts(2408)
93+
"no-this-before-super": "off", // ts(2376)
94+
"no-undef": "off", // ts(2304)
95+
"no-unreachable": "off", // ts(7027)
96+
"no-unsafe-negation": "off", // ts(2365) & ts(2360) & ts(2358)
97+
"no-var": "error", // ts transpiles let/const to var, so no need for vars any more
98+
"prefer-const": "error", // ts provides better types with const
99+
"prefer-rest-params": "error", // ts provides better types with rest args over arguments
100+
"prefer-spread": "error", // ts transpiles spread to apply, so no need for manual apply
101+
"valid-typeof": "off" // ts(2367)
102+
}
60103
}
61104
]
62105
}

.husky/prepare-commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
[[ "$(uname -a)" = *"MINGW64"* ]] && exit 0
3+
[ -n "$CI" ] && exit 0
24
. "$(dirname "$0")/_/husky.sh"
35

46
exec < /dev/tty && npx git-cz --hook || true

src/layouts/components/Header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ import { useSettingStore } from '@/store';
7070
import { getActive } from '@/router';
7171
import { prefix } from '@/config/global';
7272
import LogoFull from '@/assets/assets-logo-full.svg?component';
73-
import { MenuRoute } from '@/interface';
73+
import { MenuRoute } from '@/types/interface';
7474
7575
import Notice from './Notice.vue';
7676
import Search from './Search.vue';

src/layouts/components/MenuContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, PropType, computed, h } from 'vue';
22
import { prefix } from '@/config/global';
3-
import { MenuRoute } from '@/interface';
3+
import { MenuRoute } from '@/types/interface';
44
import { getActive } from '@/router';
55

66
const getMenuList = (list: MenuRoute[], basePath?: string): MenuRoute[] => {

src/layouts/components/Notice.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
import { useRouter } from 'vue-router';
5050
import { storeToRefs } from 'pinia';
5151
import { useNotificationStore } from '@/store';
52-
import { NotificationItem } from '@/interface';
52+
import { NotificationItem } from '@/types/interface';
5353
5454
const router = useRouter();
5555
const store = useNotificationStore();

src/layouts/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import LayoutContent from './components/Content.vue';
1111
import Setting from './setting.vue';
1212

1313
import { prefix } from '@/config/global';
14-
import { TRouterInfo } from '@/interface';
14+
import { TRouterInfo } from '@/types/interface';
1515

1616
import '@/style/layout.less';
1717

src/pages/detail/advanced/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ import { ref, onMounted } from 'vue';
121121
import { prefix } from '@/config/global';
122122
import { BASE_INFO_DATA, TABLE_COLUMNS_DATA as columns, PRODUCT_LIST } from './constants';
123123
import request from '@/utils/request';
124-
import { ResDataType } from '@/interface';
124+
import { ResDataType } from '@/types/interface';
125125
126126
import Product from './components/Product.vue';
127127

src/pages/detail/deploy/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import { BASE_INFO_DATA, TABLE_COLUMNS as columns } from './constants';
8989
import { changeChartsTheme } from '@/utils/color';
9090
9191
import { prefix } from '@/config/global';
92-
import { ResDataType } from '@/interface';
92+
import { ResDataType } from '@/types/interface';
9393
import request from '@/utils/request';
9494
9595
echarts.use([

src/pages/detail/secondary/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
import { ref, computed } from 'vue';
6161
import { storeToRefs } from 'pinia';
6262
import { NOTIFICATION_TYPES } from '@/constants';
63-
import { NotificationItem } from '@/interface';
63+
import { NotificationItem } from '@/types/interface';
6464
import EmptyIcon from '@/assets/assets-empty.svg?component';
6565
import { useNotificationStore } from '@/store';
6666

src/pages/list/base/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import { MessagePlugin } from 'tdesign-vue-next';
8282
8383
import { CONTRACT_STATUS, CONTRACT_TYPES, CONTRACT_PAYMENT_TYPES } from '@/constants';
8484
import Trend from '@/components/trend/index.vue';
85-
import { ResDataType } from '@/interface';
85+
import { ResDataType } from '@/types/interface';
8686
import request from '@/utils/request';
8787
import { useSettingStore } from '@/store';
8888

0 commit comments

Comments
 (0)