Skip to content

Commit e369644

Browse files
authored
fix: typescript 5 compatibility (#374)
Closes #373
1 parent 0775dc9 commit e369644

File tree

9 files changed

+16
-11
lines changed

9 files changed

+16
-11
lines changed

lefthook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pre-commit:
77
run: npx eslint {files}
88
types:
99
files: git diff --name-only @{push}
10-
glob: "*.{js,ts, jsx, tsx}"
10+
glob: "*.{js,ts,jsx,tsx}"
1111
run: npx tsc --noEmit
1212
commit-msg:
1313
parallel: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"eslint": "^8.18.0",
2929
"eslint-config-satya164": "^3.1.11",
3030
"prettier": "^2.7.1",
31-
"typescript": "^4.7.4"
31+
"typescript": "^5.0.2"
3232
},
3333
"commitlint": {
3434
"extends": [

packages/create-react-native-library/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import spawn from 'cross-spawn';
88
import ora from 'ora';
99
import validateNpmPackage from 'validate-npm-package-name';
1010
import githubUsername from 'github-username';
11-
import prompts, { PromptObject } from './utils/prompts';
11+
import prompts, { type PromptObject } from './utils/prompts';
1212
import generateExampleApp from './utils/generateExampleApp';
1313

1414
const FALLBACK_BOB_VERSION = '0.20.0';

packages/create-react-native-library/templates/common/$package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<% if (turborepo) { -%>
8383
"turbo": "^1.6.3",
8484
<% } -%>
85-
"typescript": "^4.5.2"
85+
"typescript": "^5.0.2"
8686
},
8787
"resolutions": {
8888
"@types/react": "17.0.21"

packages/create-react-native-library/templates/common/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"allowUnreachableCode": false,
88
"allowUnusedLabels": false,
99
"esModuleInterop": true,
10-
"importsNotUsedAsValues": "error",
1110
"forceConsistentCasingInFileNames": true,
1211
"jsx": "react",
1312
"lib": ["esnext"],
@@ -23,6 +22,7 @@
2322
"resolveJsonModule": true,
2423
"skipLibCheck": true,
2524
"strict": true,
26-
"target": "esnext"
25+
"target": "esnext",
26+
"verbatimModuleSyntax": true
2727
}
2828
}

packages/create-react-native-library/templates/native-view-legacy/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
requireNativeComponent,
33
UIManager,
44
Platform,
5-
ViewStyle,
5+
type ViewStyle,
66
} from 'react-native';
77

88
const LINKING_ERROR =

packages/react-native-builder-bob/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import dedent from 'dedent';
55
import yargs from 'yargs';
66
import { cosmiconfigSync } from 'cosmiconfig';
77
import isGitDirty from 'is-git-dirty';
8-
import prompts, { PromptObject } from './utils/prompts';
8+
import prompts, { type PromptObject } from './utils/prompts';
99
import * as logger from './utils/logger';
1010
import buildAAR from './targets/aar';
1111
import buildCommonJS from './targets/commonjs';

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"allowUnreachableCode": false,
1313
"allowUnusedLabels": false,
1414
"esModuleInterop": true,
15-
"importsNotUsedAsValues": "error",
1615
"forceConsistentCasingInFileNames": true,
1716
"jsx": "react",
1817
"lib": ["esnext", "dom"],
@@ -28,7 +27,8 @@
2827
"resolveJsonModule": true,
2928
"skipLibCheck": true,
3029
"strict": true,
31-
"target": "esnext"
30+
"target": "esnext",
31+
"verbatimModuleSyntax": true
3232
},
3333
"exclude": ["lib", "packages/create-react-native-library/templates"]
3434
}

yarn.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6346,11 +6346,16 @@ typedarray@^0.0.6:
63466346
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
63476347
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
63486348

6349-
typescript@^4.6.4, typescript@^4.7.4:
6349+
typescript@^4.6.4:
63506350
version "4.7.4"
63516351
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
63526352
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
63536353

6354+
typescript@^5.0.2:
6355+
version "5.0.2"
6356+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.2.tgz#891e1a90c5189d8506af64b9ef929fca99ba1ee5"
6357+
integrity sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==
6358+
63546359
uglify-js@^3.1.4:
63556360
version "3.8.0"
63566361
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.8.0.tgz#f3541ae97b2f048d7e7e3aa4f39fd8a1f5d7a805"

0 commit comments

Comments
 (0)