Skip to content

Commit 60f172c

Browse files
coadocipolleschi
authored andcommitted
Remove dtslint from type tests (#51382)
Summary: Pull Request resolved: #51382 This diff replaces `dtslint` which is obsolete and [It is not intended to be used on its own, but as part of the definitelytyped set of packages](https://github.com/microsoft/dtslint) in favor of `tsc` type tests. It's probably not necessary to have `test-typescript-offline` as tsc does that out of the box but doesn't test with multiple TS versions. Changelog: [Internal] Reviewed By: huntie Differential Revision: D74804967 fbshipit-source-id: 4c581ba5debf6fd0bb8dcddbb95f3c85b05082d4
1 parent 67bb783 commit 60f172c

4 files changed

Lines changed: 66 additions & 862 deletions

File tree

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
3030
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
3131
"test-ios": "./scripts/objc-test.sh test",
32-
"test-typescript-offline": "dtslint --localTs node_modules/typescript/lib packages/react-native/types",
33-
"test-typescript": "dtslint packages/react-native/types",
32+
"test-typescript": "tsc -p packages/react-native/types/tsconfig.test.json",
3433
"test": "jest",
3534
"fantom": "JS_DIR='..' yarn jest --config packages/react-native-fantom/config/jest.config.js",
3635
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
@@ -49,7 +48,6 @@
4948
"@babel/plugin-transform-regenerator": "^7.24.7",
5049
"@babel/preset-env": "^7.25.3",
5150
"@babel/preset-flow": "^7.24.7",
52-
"@definitelytyped/dtslint": "^0.0.127",
5351
"@jest/create-cache-key-function": "^29.7.0",
5452
"@react-native/metro-babel-transformer": "0.79.2",
5553
"@react-native/metro-config": "0.79.2",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": ["es6"],
5+
"noImplicitAny": true,
6+
"noImplicitThis": true,
7+
"strictFunctionTypes": true,
8+
"strictNullChecks": true,
9+
"types": [],
10+
"jsx": "react",
11+
"noEmit": true,
12+
"forceConsistentCasingInFileNames": true,
13+
"paths": {"react-native": ["."]}
14+
},
15+
"include": ["../**/*.d.ts", "__typetests__/**/*"]
16+
}

scripts/run-ci-javascript-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ try {
103103
}
104104

105105
describe('Test: TypeScript tests');
106-
if (exec(`${YARN_BINARY} run test-typescript-offline`).code) {
106+
if (exec(`${YARN_BINARY} run test-typescript`).code) {
107107
echo('Failed to run TypeScript tests.');
108108
exitCode = 1;
109109
throw Error(exitCode);

0 commit comments

Comments
 (0)