Skip to content

Commit 4b0165d

Browse files
committed
fix: 🐛 centralize tsconfig
1 parent 2f2def3 commit 4b0165d

File tree

12 files changed

+94
-326
lines changed

12 files changed

+94
-326
lines changed

apps/example-expo/app/_layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { useColorScheme } from '@/hooks/useColorScheme';
1515
SplashScreen.preventAutoHideAsync();
1616

1717
export default function RootLayout() {
18-
console.log('RootLayout');
1918
const colorScheme = useColorScheme();
2019
const [loaded] = useFonts({
2120
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),

apps/example-expo/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const tabView = require('../../packages/react-native-bottom-tabs/package.json');
33
const reactNavigationIntegration = require('../../packages/react-navigation/package.json');
44

55
module.exports = {
6-
presets: ['module:@react-native/babel-preset'],
6+
presets: ['babel-preset-expo'],
77
plugins: [
88
[
99
'module-resolver',

apps/example/tsconfig.json

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
11
{
2+
"extends": "../tsconfig",
3+
"references": [
4+
{ "path": "../../packages/react-native-bottom-tabs" },
5+
{ "path": "../../packages/react-navigation" },
6+
],
27
"compilerOptions": {
3-
"paths": {
4-
"react-native-bottom-tabs": ["../../packages/react-native-bottom-tabs/src/index"],
5-
"@bottom-tabs/react-navigation": [
6-
"../../packages/react-navigation/src/index"
7-
]
8-
},
9-
"allowUnreachableCode": false,
10-
"allowUnusedLabels": false,
11-
"esModuleInterop": true,
12-
"forceConsistentCasingInFileNames": true,
13-
"jsx": "react-jsx",
14-
"lib": ["ESNext"],
15-
"module": "ESNext",
16-
"moduleResolution": "Bundler",
17-
"noFallthroughCasesInSwitch": true,
18-
"noImplicitReturns": true,
19-
"noImplicitUseStrict": false,
20-
"noStrictGenericChecks": false,
21-
"noUncheckedIndexedAccess": true,
22-
"noUnusedLocals": true,
23-
"noUnusedParameters": true,
24-
"resolveJsonModule": true,
25-
"skipLibCheck": true,
26-
"strict": true,
27-
"target": "ESNext",
28-
"verbatimModuleSyntax": true
8+
"rootDir": "."
299
}
3010
}

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@native-tabs/monorepo",
2+
"name": "@bottom-tabs/monorepo",
33
"private": true,
44
"workspaces": {
55
"packages": [
@@ -30,6 +30,7 @@
3030
"eslint": "^8.51.0",
3131
"eslint-config-prettier": "^9.0.0",
3232
"eslint-plugin-prettier": "^5.0.1",
33+
"jest": "^29.7.0",
3334
"prettier": "^3.0.3",
3435
"turbo": "^2.1.0",
3536
"typescript": "^5.2.2"
@@ -39,6 +40,13 @@
3940
"@commitlint/config-conventional"
4041
]
4142
},
43+
"jest": {
44+
"preset": "react-native",
45+
"modulePathIgnorePatterns": [
46+
"<rootDir>/example/node_modules",
47+
"<rootDir>/lib/"
48+
]
49+
},
4250
"prettier": {
4351
"quoteProps": "consistent",
4452
"singleQuote": true,

packages/react-native-bottom-tabs/package.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,11 @@
7878
"registry": "https://registry.npmjs.org/"
7979
},
8080
"devDependencies": {
81-
"@commitlint/config-conventional": "^17.0.2",
82-
"@evilmartians/lefthook": "^1.5.0",
8381
"@expo/config-plugins": "^7.0.0 || ^8.0.0",
8482
"@react-native/babel-preset": "0.76.2",
8583
"@react-native/eslint-config": "0.76.2",
86-
"@react-navigation/native": "^6.1.18",
8784
"@types/jest": "^29.5.5",
8885
"@types/react": "^18.2.44",
89-
"commitlint": "^17.0.2",
90-
"del-cli": "^5.1.0",
91-
"jest": "^29.7.0",
9286
"react": "18.3.1",
9387
"react-native": "0.75.4",
9488
"react-native-builder-bob": "^0.30.2",
@@ -99,19 +93,6 @@
9993
"react": "*",
10094
"react-native": "*"
10195
},
102-
"packageManager": "yarn@3.6.1",
103-
"jest": {
104-
"preset": "react-native",
105-
"modulePathIgnorePatterns": [
106-
"<rootDir>/example/node_modules",
107-
"<rootDir>/lib/"
108-
]
109-
},
110-
"commitlint": {
111-
"extends": [
112-
"@commitlint/config-conventional"
113-
]
114-
},
11596
"release-it": {
11697
"git": {
11798
"commitMessage": "chore: release ${version}",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"paths": {}
5+
},
36
"exclude": ["lib"]
47
}
Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
{
2+
"extends": "../../tsconfig",
23
"compilerOptions": {
34
"rootDir": ".",
4-
"paths": {
5-
"react-native-bottom-tabs": ["./src/index"],
6-
"react-native-bottom-tabs/react-navigation": [
7-
"./src/react-navigation/index"
8-
]
9-
},
10-
"allowUnreachableCode": false,
11-
"allowUnusedLabels": false,
12-
"esModuleInterop": true,
13-
"forceConsistentCasingInFileNames": true,
14-
"jsx": "react-jsx",
15-
"lib": ["ESNext"],
16-
"module": "ESNext",
17-
"moduleResolution": "Bundler",
18-
"noEmit": true,
19-
"noFallthroughCasesInSwitch": true,
20-
"noImplicitReturns": true,
21-
"noImplicitUseStrict": false,
22-
"noStrictGenericChecks": false,
23-
"noUncheckedIndexedAccess": true,
24-
"noUnusedLocals": true,
25-
"noUnusedParameters": true,
26-
"resolveJsonModule": true,
27-
"skipLibCheck": true,
28-
"strict": true,
29-
"target": "ESNext"
305
}
316
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"paths": {}
5+
},
36
"exclude": ["lib"]
47
}
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
{
2+
"extends": "../../tsconfig",
23
"compilerOptions": {
34
"rootDir": ".",
4-
"paths": {
5-
"@bottom-tabs/react-navigation": ["./src/index"],
6-
},
7-
"allowUnreachableCode": false,
8-
"allowUnusedLabels": false,
9-
"esModuleInterop": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"jsx": "react-jsx",
12-
"lib": ["ESNext"],
13-
"module": "ESNext",
14-
"moduleResolution": "Bundler",
15-
"noEmit": true,
16-
"noFallthroughCasesInSwitch": true,
17-
"noImplicitReturns": true,
18-
"noImplicitUseStrict": false,
19-
"noStrictGenericChecks": false,
20-
"noUncheckedIndexedAccess": true,
21-
"noUnusedLocals": true,
22-
"noUnusedParameters": true,
23-
"resolveJsonModule": true,
24-
"skipLibCheck": true,
25-
"strict": true,
26-
"target": "ESNext"
5+
"paths": {}
276
}
287
}

tsconfig.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
"paths": {
4+
"react-native-bottom-tabs": ["./packages/react-native-bottom-tabs/src/index"],
5+
"@bottom-tabs/react-navigation": ["./packages/react-navigation/src/index"],
6+
},
7+
"allowUnreachableCode": false,
8+
"allowUnusedLabels": false,
9+
"esModuleInterop": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"jsx": "react-jsx",
12+
"lib": ["ESNext"],
13+
"module": "ESNext",
14+
"moduleResolution": "Bundler",
15+
"noEmit": true,
16+
"noFallthroughCasesInSwitch": true,
17+
"noImplicitReturns": true,
18+
"noImplicitUseStrict": false,
19+
"noStrictGenericChecks": false,
20+
"noUncheckedIndexedAccess": true,
21+
"noUnusedLocals": true,
22+
"noUnusedParameters": true,
23+
"resolveJsonModule": true,
24+
"skipLibCheck": true,
25+
"strict": true,
26+
"target": "ESNext"
27+
}
28+
}

turbo.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
"$schema": "https://turbo.build/schema.json",
33
"tasks": {
44
"lint": {
5+
"dependsOn": ["prepare"],
56
"inputs": ["**/*.ts", "**/*.tsx", "**/*.js"]
67
},
78
"typecheck": {
9+
"dependsOn": ["prepare"],
810
"inputs": ["**/*.ts", "**/*.tsx"]
911
},
1012
"test": {},
11-
"prepare": {},
13+
"prepare": {
14+
"dependsOn": ["^prepare"],
15+
"outputs": ["lib/**"],
16+
"inputs": ["src/**/*.ts", "src/**/*.tsx"]
17+
},
1218
"build:android": {
1319
"env": ["JAVA_HOME", "ANDROID_NDK", "ANDROID_SDK", "ANDROID_HOME"],
1420
"inputs": [

0 commit comments

Comments
 (0)