This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 14 files changed +113
-78
lines changed Expand file tree Collapse file tree 14 files changed +113
-78
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ module.exports = {
8
8
'@groupher/eslint-config-web' ,
9
9
'eslint:recommended' ,
10
10
'plugin:@typescript-eslint/recommended' ,
11
+ // see: https://stackoverflow.com/a/56696478/4050784
12
+ 'plugin:import/typescript' ,
11
13
] ,
12
14
// extends: ['@groupher/eslint-config-web'],
13
15
settings : {
Original file line number Diff line number Diff line change 161
161
"shelljs" : " 0.8.4" ,
162
162
"standard-version" : " ^8.0.1" ,
163
163
"start-server-and-test" : " 1.12.1" ,
164
+ "type-fest" : " ^2.12.2" ,
164
165
"typescript" : " ^4.2.3"
165
166
}
166
167
}
Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ export type TUpvoteLayout =
210
210
| 'comment'
211
211
| 'article'
212
212
| 'post-list'
213
+ | 'blog-list'
213
214
| 'works-article'
214
215
| 'works-card'
215
216
| 'guide-list'
Original file line number Diff line number Diff line change
1
+ // see: https://github.com/sindresorhus/type-fest#template-literal-types
2
+ export type { ScreamingSnakeCase as SnakeUpperCase } from 'type-fest'
3
+ export type holder = 1
Original file line number Diff line number Diff line change 1
1
import type { TRootStore as RootStoreType } from '@/stores/RootStore'
2
+
2
3
import type { TArticle } from './article'
3
4
import type { TCommunity } from './community'
4
5
6
+ export type { SnakeUpperCase } from './enhance'
7
+
5
8
export type { TMetric } from './metric'
6
9
export type {
7
10
TSIZE ,
Original file line number Diff line number Diff line change @@ -96,7 +96,11 @@ export type TTabItem = {
96
96
97
97
export type TResState = 'LOADING' | 'DONE' | 'EMPTY'
98
98
99
- export type TPaymentUsage = 'SENIOR' | 'GirlsCodeTooPlan' | 'DONATE' | 'SPONSOR'
99
+ export type TPaymentUsage =
100
+ | 'SENIOR'
101
+ | 'GIRLS_CODE_TOO_PLAN'
102
+ | 'DONATE'
103
+ | 'SPONSOR'
100
104
export type TPaymentMethod = 'ALIPAY' | 'WECHAT'
101
105
102
106
export type TFlexRule =
@@ -183,7 +187,7 @@ export type TModelineType =
183
187
| 'search'
184
188
| 'more'
185
189
186
- export type TGtdType = 'BUG' | 'FEATURE' | null
187
- export type TGtdState = 'TODO' | 'WIP' | 'DONE' | null
190
+ export type TGtdType = 'BUG' | 'FEATURE' | 'DEFAULT'
191
+ export type TGtdState = 'TODO' | 'WIP' | 'DONE' | 'DEFAULT'
188
192
189
193
export type TTagMode = 'default' | 'label'
Original file line number Diff line number Diff line change 1
1
import type { TGtdType , TGtdState } from '@/spec'
2
2
3
3
export const GTD_TYPE = {
4
- FEATURE : 'FEATURE' as TGtdType ,
5
- BUG : 'BUG' as TGtdType ,
6
- DEFAULT : null as TGtdType ,
7
- }
4
+ FEATURE : 'FEATURE' ,
5
+ BUG : 'BUG' ,
6
+ DEFAULT : 'DEFAULT' ,
7
+ } as Record < Uppercase < TGtdType > , Uppercase < TGtdType > >
8
8
9
9
export const GTD_STATE = {
10
- TODO : 'TODO' as TGtdState ,
11
- WIP : 'WIP' as TGtdState ,
12
- DONE : 'DONE' as TGtdState ,
13
- DEFAULT : null as TGtdState ,
14
- }
10
+ TODO : 'TODO' ,
11
+ WIP : 'WIP' ,
12
+ DONE : 'DONE' ,
13
+ DEFAULT : 'DEFAULT' ,
14
+ } as Record < Uppercase < TGtdState > , Uppercase < TGtdState > >
Original file line number Diff line number Diff line change 1
1
import type { TEmotionType } from '@/spec'
2
2
3
3
const EMOTION = {
4
- DOWNVOTE : 'downvote' as TEmotionType ,
5
- BEER : 'beer' as TEmotionType ,
6
- HEART : 'heart' as TEmotionType ,
7
- CONFUSED : 'confused' as TEmotionType ,
8
- POPCORN : 'popcorn' as TEmotionType ,
9
- PILL : 'pill' as TEmotionType ,
10
- }
4
+ DOWNVOTE : 'downvote' ,
5
+ BEER : 'beer' ,
6
+ HEART : 'heart' ,
7
+ CONFUSED : 'confused' ,
8
+ POPCORN : 'popcorn' ,
9
+ PILL : 'pill' ,
10
+ } as Record < Uppercase < TEmotionType > , TEmotionType >
11
11
12
12
export default EMOTION
Original file line number Diff line number Diff line change 1
- import type { TUpvoteLayout } from '@/spec'
1
+ import type { TUpvoteLayout , SnakeUpperCase } from '@/spec'
2
2
3
3
export const UPVOTE_LAYOUT = {
4
- DEFAULT : 'default' as TUpvoteLayout ,
5
- COMMENT : 'comment' as TUpvoteLayout ,
6
- ARTICLE : 'article' as TUpvoteLayout ,
7
- POST_LIST : 'post-list' as TUpvoteLayout ,
8
- BLOG_LIST : 'blog-list' as TUpvoteLayout ,
9
- WORKS_ARTICLE : 'works-article' as TUpvoteLayout ,
10
- WORKS_CARD : 'works-card' as TUpvoteLayout ,
11
- GUIDE_LIST : 'guide-list' as TUpvoteLayout ,
12
- }
4
+ DEFAULT : 'default' ,
5
+ COMMENT : 'comment' ,
6
+ ARTICLE : 'article' ,
7
+ POST_LIST : 'post-list' ,
8
+ BLOG_LIST : 'blog-list' ,
9
+ WORKS_ARTICLE : 'works-article' ,
10
+ WORKS_CARD : 'works-card' ,
11
+ GUIDE_LIST : 'guide-list' ,
12
+ } as Record < SnakeUpperCase < TUpvoteLayout > , TUpvoteLayout >
13
13
14
14
export const holder = 1
You can’t perform that action at this time.
0 commit comments