Skip to content

Commit b482f61

Browse files
authored
Upgrade to typescript v4 (#1324)
* Upgrade to typescript v4 * Upgrade eslint and fix lint errors * Fix formatting issues in WheelPicker * Fix lint and tests issues
1 parent 944f57f commit b482f61

File tree

43 files changed

+574
-4623
lines changed

Some content is hidden

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

43 files changed

+574
-4623
lines changed

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
rules: {
66
/* Disabled rules for typescript */
77
'no-dupe-class-members': 'off',
8+
'no-undef': 'off',
89
/* Other Rules */
910
'no-unused-expressions': 'off',
1011
'arrow-parens': 'off',
@@ -37,8 +38,11 @@ module.exports = {
3738
'@typescript-eslint/explicit-member-accessibility': 0,
3839
'@typescript-eslint/prefer-optional-chain': 'error',
3940
'@typescript-eslint/ban-ts-ignore': 0,
41+
'@typescript-eslint/ban-ts-comment': 0,
42+
'@typescript-eslint/ban-types': 0,
4043
'@typescript-eslint/no-empty-function': 0,
4144
'@typescript-eslint/camelcase': 0,
42-
'@typescript-eslint/indent': 0
45+
'@typescript-eslint/indent': 0,
46+
'@typescript-eslint/explicit-module-boundary-types': 0
4347
}
4448
};

generatedTypes/commons/modifiers.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ export declare function extractModifierProps(props: Dictionary<any>): _.Dictiona
9292
* TODO:
9393
* @deprecated switch to Modifiers#extractComponentProps
9494
*/
95-
export declare function extractOwnProps(props: Dictionary<any>, ignoreProps: string[]): Pick<Partial<Dictionary<any>>, number>;
96-
export declare function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps?: string[]): Pick<Partial<Dictionary<any>>, number>;
95+
export declare function extractOwnProps(props: Dictionary<any>, ignoreProps: string[]): _.Omit<Partial<Dictionary<any>>, string>;
96+
export declare function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps?: string[]): _.Omit<Partial<Dictionary<any>>, string>;
9797
export declare function getThemeProps(props?: any, context?: any): any;
9898
export declare function generateModifiersStyle(options: {
9999
color: boolean;

generatedTypes/components/avatar/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ declare const _default: React.ComponentClass<Pick<AccessibilityProps, "accessibi
218218
/**
219219
* The image source (external or assets)
220220
*/
221-
source?: number | import("react-native").ImageURISource | import("react-native").ImageURISource[] | undefined;
221+
source?: ImageSourcePropType | undefined;
222222
/**
223223
* Image props object
224224
*/

generatedTypes/components/badge/index.d.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ declare function createStyles(props: BadgeProps): {
128128
textAlign?: "auto" | "left" | "right" | "center" | "justify" | undefined;
129129
textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through" | undefined;
130130
textDecorationStyle?: "solid" | "double" | "dotted" | "dashed" | undefined;
131-
textDecorationColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
132-
textShadowColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
131+
textDecorationColor?: import("react-native").ColorValue | undefined;
132+
textShadowColor?: import("react-native").ColorValue | undefined;
133133
textShadowOffset?: {
134134
width: number;
135135
height: number;
@@ -140,22 +140,22 @@ declare function createStyles(props: BadgeProps): {
140140
fontVariant?: import("react-native").FontVariant[] | undefined;
141141
writingDirection?: "auto" | "ltr" | "rtl" | undefined;
142142
backfaceVisibility?: "visible" | "hidden" | undefined;
143-
borderBottomColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
143+
borderBottomColor?: import("react-native").ColorValue | undefined;
144144
borderBottomEndRadius?: number | undefined;
145145
borderBottomLeftRadius?: number | undefined;
146146
borderBottomRightRadius?: number | undefined;
147147
borderBottomStartRadius?: number | undefined;
148148
borderBottomWidth?: number | undefined;
149-
borderColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
150-
borderEndColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
151-
borderLeftColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
149+
borderColor?: import("react-native").ColorValue | undefined;
150+
borderEndColor?: import("react-native").ColorValue | undefined;
151+
borderLeftColor?: import("react-native").ColorValue | undefined;
152152
borderLeftWidth?: number | undefined;
153153
borderRadius?: number | undefined;
154-
borderRightColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
154+
borderRightColor?: import("react-native").ColorValue | undefined;
155155
borderRightWidth?: number | undefined;
156-
borderStartColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
156+
borderStartColor?: import("react-native").ColorValue | undefined;
157157
borderStyle?: "solid" | "dotted" | "dashed" | undefined;
158-
borderTopColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
158+
borderTopColor?: import("react-native").ColorValue | undefined;
159159
borderTopEndRadius?: number | undefined;
160160
borderTopLeftRadius?: number | undefined;
161161
borderTopRightRadius?: number | undefined;
@@ -165,8 +165,8 @@ declare function createStyles(props: BadgeProps): {
165165
opacity?: number | undefined;
166166
elevation?: number | undefined;
167167
alignContent?: "center" | "flex-start" | "flex-end" | "stretch" | "space-between" | "space-around" | undefined;
168-
alignItems?: "center" | "flex-start" | "flex-end" | "stretch" | "baseline" | undefined;
169-
alignSelf?: "auto" | "center" | "flex-start" | "flex-end" | "stretch" | "baseline" | undefined;
168+
alignItems?: import("react-native").FlexAlignType | undefined;
169+
alignSelf?: "auto" | import("react-native").FlexAlignType | undefined;
170170
aspectRatio?: number | undefined;
171171
borderEndWidth?: string | number | undefined;
172172
borderStartWidth?: string | number | undefined;
@@ -212,7 +212,7 @@ declare function createStyles(props: BadgeProps): {
212212
width?: string | number | undefined;
213213
zIndex?: number | undefined;
214214
direction?: "ltr" | "rtl" | "inherit" | undefined;
215-
shadowColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
215+
shadowColor?: import("react-native").ColorValue | undefined;
216216
shadowOffset?: {
217217
width: number;
218218
height: number;
@@ -231,7 +231,7 @@ declare function createStyles(props: BadgeProps): {
231231
};
232232
labelSmall: {
233233
lineHeight: undefined;
234-
color?: string | typeof import("react-native").OpaqueColorValue | undefined;
234+
color?: import("react-native").ColorValue | undefined;
235235
fontFamily?: string | undefined;
236236
fontSize?: number | undefined;
237237
fontStyle?: "normal" | "italic" | undefined;
@@ -240,8 +240,8 @@ declare function createStyles(props: BadgeProps): {
240240
textAlign?: "auto" | "left" | "right" | "center" | "justify" | undefined;
241241
textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through" | undefined;
242242
textDecorationStyle?: "solid" | "double" | "dotted" | "dashed" | undefined;
243-
textDecorationColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
244-
textShadowColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
243+
textDecorationColor?: import("react-native").ColorValue | undefined;
244+
textShadowColor?: import("react-native").ColorValue | undefined;
245245
textShadowOffset?: {
246246
width: number;
247247
height: number;
@@ -252,23 +252,23 @@ declare function createStyles(props: BadgeProps): {
252252
fontVariant?: import("react-native").FontVariant[] | undefined;
253253
writingDirection?: "auto" | "ltr" | "rtl" | undefined;
254254
backfaceVisibility?: "visible" | "hidden" | undefined;
255-
backgroundColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
256-
borderBottomColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
255+
backgroundColor?: import("react-native").ColorValue | undefined;
256+
borderBottomColor?: import("react-native").ColorValue | undefined;
257257
borderBottomEndRadius?: number | undefined;
258258
borderBottomLeftRadius?: number | undefined;
259259
borderBottomRightRadius?: number | undefined;
260260
borderBottomStartRadius?: number | undefined;
261261
borderBottomWidth?: number | undefined;
262-
borderColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
263-
borderEndColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
264-
borderLeftColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
262+
borderColor?: import("react-native").ColorValue | undefined;
263+
borderEndColor?: import("react-native").ColorValue | undefined;
264+
borderLeftColor?: import("react-native").ColorValue | undefined;
265265
borderLeftWidth?: number | undefined;
266266
borderRadius?: number | undefined;
267-
borderRightColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
267+
borderRightColor?: import("react-native").ColorValue | undefined;
268268
borderRightWidth?: number | undefined;
269-
borderStartColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
269+
borderStartColor?: import("react-native").ColorValue | undefined;
270270
borderStyle?: "solid" | "dotted" | "dashed" | undefined;
271-
borderTopColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
271+
borderTopColor?: import("react-native").ColorValue | undefined;
272272
borderTopEndRadius?: number | undefined;
273273
borderTopLeftRadius?: number | undefined;
274274
borderTopRightRadius?: number | undefined;
@@ -278,8 +278,8 @@ declare function createStyles(props: BadgeProps): {
278278
opacity?: number | undefined;
279279
elevation?: number | undefined;
280280
alignContent?: "center" | "flex-start" | "flex-end" | "stretch" | "space-between" | "space-around" | undefined;
281-
alignItems?: "center" | "flex-start" | "flex-end" | "stretch" | "baseline" | undefined;
282-
alignSelf?: "auto" | "center" | "flex-start" | "flex-end" | "stretch" | "baseline" | undefined;
281+
alignItems?: import("react-native").FlexAlignType | undefined;
282+
alignSelf?: "auto" | import("react-native").FlexAlignType | undefined;
283283
aspectRatio?: number | undefined;
284284
borderEndWidth?: string | number | undefined;
285285
borderStartWidth?: string | number | undefined;
@@ -325,7 +325,7 @@ declare function createStyles(props: BadgeProps): {
325325
width?: string | number | undefined;
326326
zIndex?: number | undefined;
327327
direction?: "ltr" | "rtl" | "inherit" | undefined;
328-
shadowColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
328+
shadowColor?: import("react-native").ColorValue | undefined;
329329
shadowOffset?: {
330330
width: number;
331331
height: number;
@@ -377,7 +377,7 @@ declare const _default: React.ComponentClass<ViewProps & TouchableOpacityProps &
377377
/**
378378
* color of border around the badge
379379
*/
380-
borderColor?: string | typeof import("react-native").OpaqueColorValue | undefined;
380+
borderColor?: import("react-native").ColorValue | undefined;
381381
/**
382382
* Additional styles for the top container
383383
*/
@@ -396,7 +396,7 @@ declare const _default: React.ComponentClass<ViewProps & TouchableOpacityProps &
396396
/**
397397
* Renders an icon badge
398398
*/
399-
icon?: number | import("react-native").ImageURISource | import("react-native").ImageURISource[] | undefined;
399+
icon?: ImageSourcePropType | undefined;
400400
/**
401401
* Additional styling to badge icon
402402
*/

0 commit comments

Comments
 (0)