Skip to content

Commit 44eb933

Browse files
committed
Refactor type-only imports to TS 3.8 syntax (create transformer/lint rule pronto)
Ref: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export
1 parent 7a6b8ba commit 44eb933

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

node.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable import/no-extraneous-dependencies */
2-
import { Application, Context } from '@curveball/core'
2+
3+
import { type Context, Application } from '@curveball/core'
34
import router from '@curveball/router'
45

56
const app = new Application()

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable react-native/no-raw-text */
22
// https://github.com/Intellicode/eslint-plugin-react-native/issues/271
33

4-
import { FC } from 'react'
4+
import type { FC } from 'react'
55
import {
66
SafeAreaView,
77
ScrollView,
@@ -110,7 +110,7 @@ const styles = StyleSheet.create({
110110
}
111111
})
112112

113-
export default false ? StorybookUIRoot : App
113+
export default true ? StorybookUIRoot : App
114114

115115
// export default Reactotron.storybookSwitcher(storybook)(App)
116116
// https://github.com/infinitered/reactotron/issues/1160

storybook/stories/Button/index.android.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC } from 'react'
1+
import type { FC } from 'react'
22
import { TouchableNativeFeedback } from 'react-native'
33

44
const Button: FC<{ onPress: () => void }> = ({

storybook/stories/Button/index.ios.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC } from 'react'
1+
import type { FC } from 'react'
22
import { TouchableHighlight } from 'react-native'
33

44
const Button: FC<{ onPress: () => void }> = ({

storybook/stories/CenterView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
22
import PropTypes from 'prop-types'
3-
import { FC } from 'react'
3+
import type { FC } from 'react'
44
import { View } from 'react-native'
55

66
import style from './style'

storybook/stories/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { action } from '@storybook/addon-actions'
22
import { text, withKnobs } from '@storybook/addon-knobs'
33
import { linkTo } from '@storybook/addon-links'
44
import { storiesOf } from '@storybook/react-native'
5-
import { Component } from 'react'
5+
import type { FC } from 'react'
66
import { Text } from 'react-native'
77

88
import Button from './Button'
@@ -15,7 +15,7 @@ storiesOf('Welcome', module).add('to Storybook', () => (
1515

1616
storiesOf('Button', module)
1717
.addDecorator(withKnobs)
18-
.addDecorator(getStory => <CenterView>{getStory() as Component}</CenterView>)
18+
.addDecorator(getStory => <CenterView>{getStory() as FC}</CenterView>)
1919
.add('with text', () => (
2020
<Button onPress={action('clicked-text')}>
2121
<Text>{text('title', 'Button Title')}</Text>

types/globals.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
2-
import { Reactotron } from 'reactotron-core-client'
3-
import { ReactotronReactNative } from 'reactotron-react-native'
1+
import type { Reactotron } from 'reactotron-core-client'
2+
import type { ReactotronReactNative } from 'reactotron-react-native'
43

54
declare global {
65
interface Console {

0 commit comments

Comments
 (0)