Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit c9b8c22

Browse files
committed
chore: update typescript config
This will let people install the package from GitHub without type errors
1 parent cf9e7a2 commit c9b8c22

File tree

10 files changed

+23
-13
lines changed

10 files changed

+23
-13
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@
8989
"targets": [
9090
"commonjs",
9191
"module",
92-
"typescript"
92+
[
93+
"typescript",
94+
{
95+
"project": "tsconfig.build.json"
96+
}
97+
]
9398
]
9499
}
95100
}

src/PagerViewAdapter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ViewPager, {
44
PageScrollStateChangedNativeEvent,
55
} from 'react-native-pager-view';
66
import useAnimatedValue from './useAnimatedValue';
7-
import {
7+
import type {
88
NavigationState,
99
Route,
1010
Listener,

src/PanResponderAdapter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
View,
1111
} from 'react-native';
1212
import useAnimatedValue from './useAnimatedValue';
13-
import {
13+
import type {
1414
NavigationState,
1515
Route,
1616
Layout,
@@ -48,7 +48,7 @@ const DefaultTransitionSpec = {
4848
overshootClamping: true,
4949
};
5050

51-
export default function Pager<T extends Route>({
51+
export default function PanResponderAdapter<T extends Route>({
5252
layout,
5353
keyboardDismissMode = 'auto',
5454
swipeEnabled = true,

src/SceneView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
3-
import {
3+
import type {
44
SceneRendererProps,
55
EventEmitterProps,
66
NavigationState,

src/TabBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from 'react-native';
1414
import TabBarItem, { Props as TabBarItemProps } from './TabBarItem';
1515
import TabBarIndicator, { Props as IndicatorProps } from './TabBarIndicator';
16-
import {
16+
import type {
1717
Route,
1818
Scene,
1919
SceneRendererProps,

src/TabBarIndicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Platform,
1010
} from 'react-native';
1111

12-
import { Route, SceneRendererProps, NavigationState } from './types';
12+
import type { Route, SceneRendererProps, NavigationState } from './types';
1313

1414
export type GetTabWidth = (index: number) => number;
1515

src/TabBarItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ViewStyle,
1010
} from 'react-native';
1111
import PlatformPressable from './PlatformPressable';
12-
import { Scene, Route, NavigationState } from './types';
12+
import type { Scene, Route, NavigationState } from './types';
1313

1414
export type Props<T extends Route> = {
1515
position: Animated.AnimatedInterpolation;

src/TabView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import TabBar from './TabBar';
1010
import SceneView from './SceneView';
1111
import Pager from './Pager';
12-
import {
12+
import type {
1313
Layout,
1414
NavigationState,
1515
Route,

tsconfig.build.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig",
3+
"exclude": ["example"]
4+
}

tsconfig.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
"paths": {
55
"react-native-tab-view": ["./src/index"]
66
},
7-
"composite": true,
87
"allowUnreachableCode": false,
98
"allowUnusedLabels": false,
109
"esModuleInterop": true,
1110
"forceConsistentCasingInFileNames": true,
11+
"importsNotUsedAsValues": "error",
12+
"isolatedModules": true,
1213
"jsx": "react",
1314
"lib": ["esnext", "dom"],
1415
"module": "esnext",
@@ -22,7 +23,7 @@
2223
"resolveJsonModule": true,
2324
"skipLibCheck": true,
2425
"strict": true,
25-
"target": "esnext",
26-
"isolatedModules": true,
27-
}
26+
"target": "esnext"
27+
},
28+
"exclude": ["lib/**/*"]
2829
}

0 commit comments

Comments
 (0)