Skip to content

Commit e44a610

Browse files
committed
new eslint
1 parent 8b6c0e1 commit e44a610

File tree

192 files changed

+2693
-2352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+2693
-2352
lines changed

packages/api/src/getUserInfo.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import sh from 'shelljs'
2-
import chalk from 'chalk'
3-
import request from '@jssj/request'
1+
import type { FetchDataType } from './types'
42
import { getConfig, getGitUser } from '@gitmars/git'
53
import { debug } from '@gitmars/utils'
6-
import type { FetchDataType } from './types'
4+
import request from '@jssj/request'
5+
import chalk from 'chalk'
6+
import sh from 'shelljs'
77
import lang from './lang'
88

99
const { t } = lang
@@ -12,32 +12,36 @@ const { t } = lang
1212
async function getUserInfo(): Promise<FetchDataType> {
1313
const config = getConfig()
1414
const userInfoApi = config.apis?.userInfo?.url || config.api
15+
1516
if (!userInfoApi) {
1617
sh.echo(
1718
chalk.red(
1819
t(
19-
'Please configure the address of the api interface used to request permissions, receive parameters in the form: url?name=git_user_name, return data.level'
20-
)
21-
)
20+
'Please configure the address of the api interface used to request permissions, receive parameters in the form: url?name=git_user_name, return data.level',
21+
),
22+
),
2223
)
2324
process.exit(1)
2425
}
2526

2627
const user = getGitUser()
28+
2729
if (!user) {
2830
sh.echo(chalk.red(t('Please set the local git user name')))
2931
process.exit(1)
3032
}
3133

3234
const fetchData =
3335
((await request.get({ url: `${userInfoApi}?name=${user}` })).data as FetchDataType) || null
36+
3437
debug('getUserInfo-user', user, userInfoApi)
3538
debug('getUserInfo-fetchData', fetchData)
3639

3740
if (!fetchData) {
3841
sh.echo(chalk.red(t('No user found, please contact admin')))
3942
process.exit(1)
4043
}
44+
4145
return fetchData
4246
}
4347

packages/api/src/index.default.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ import {
99
getMergeRequestDiffVersions,
1010
getMergeRequestList,
1111
getMergeRequestParticipants,
12-
updateMergeRequest
12+
updateMergeRequest,
1313
} from './mergeRequest'
1414
import {
1515
createMergeRequestNotes,
1616
deleteMergeRequestNotes,
1717
getMergeRequestNotesDetail,
1818
getMergeRequestNotesList,
19-
updateMergeRequestNotes
19+
updateMergeRequestNotes,
2020
} from './mergeRequestNotes'
2121
import {
2222
getAuditStatus,
2323
getAuthorizerListWithAllDetail,
2424
getPreAuthQrCode,
2525
getTrialQrCode,
26-
submitAudit
26+
submitAudit,
2727
} from './miniprogram'
2828

2929
export type * from './types'
@@ -51,5 +51,5 @@ export default {
5151
getAuditStatus,
5252
getTrialQrCode,
5353
submitAudit,
54-
getPreAuthQrCode
54+
getPreAuthQrCode,
5555
}

packages/api/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export { default as getUserInfo } from './getUserInfo'
2+
export { default } from './index.default'
23
export * from './mergeRequest'
34
export * from './mergeRequestNotes'
4-
export * from './miniprogram'
55

6-
export { default } from './index.default'
6+
export * from './miniprogram'
77
export type * from './types'
88
export const version = '__VERSION__' as string

packages/api/src/lang.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { osLangSync } from 'os-lang'
21
import { useLocale } from '@gitmars/utils'
2+
import { osLangSync } from 'os-lang'
33
import * as languages from './locales'
44

55
export type LanguageType = Exclude<keyof typeof languages, 'default'>
66

77
const locales: LanguageType[] = ['enUS', 'zhCN']
88
let localeName = (process.env.GITMARS_LANG || osLangSync()).replace('-', '') as LanguageType
9+
910
if (!locales.includes(localeName)) localeName = 'enUS'
1011

1112
export default useLocale(languages[localeName])

packages/api/src/locales/en-US.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default {
2-
name: 'en-US'
2+
name: 'en-US',
33
}

packages/api/src/locales/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export { default as zhCN } from './zh-CN'
21
export { default as enUS } from './en-US'
2+
export { default as zhCN } from './zh-CN'
33

44
export interface TranslatePair {
55
[key: string]: string | string[] | TranslatePair

packages/api/src/locales/zh-CN.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export default {
44
'请配置用于请求权限的api接口地址,接收参数形式:url?name=git_user_name,返回data.level',
55
'Please set the local git user name': '请设置本地git用户名',
66
'No user found, please contact admin': '没有找到用户,请联系管理员',
7-
'The request reported an error': '请求报错了'
7+
'The request reported an error': '请求报错了',
88
}

0 commit comments

Comments
 (0)