Skip to content

Commit 12f46fc

Browse files
committed
test(ts): Added a TS compilation check
1 parent faba1bf commit 12f46fc

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

package-lock.json

+21-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
"cordova-windows"
2727
],
2828
"scripts": {
29-
"test": "npm run lint",
30-
"lint": "eslint ."
29+
"test": "npm run lint && npm run test:types",
30+
"lint": "eslint .",
31+
"test:types": "tsc --project ./types/tests/tsconfig.json"
3132
},
3233
"author": "Apache Software Foundation",
3334
"license": "Apache-2.0",
@@ -48,6 +49,7 @@
4849
}
4950
},
5051
"devDependencies": {
51-
"@cordova/eslint-config": "^5.0.0"
52+
"@cordova/eslint-config": "^5.0.0",
53+
"typescript": "^5.1.6"
5254
}
5355
}

types/tests/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
// Intentionally empty file, but
3+
// further tests can be added to ensure type usages
4+
// can work as expected

types/tests/tsconfig.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"noEmit": true
4+
},
5+
"files": [
6+
"../index.d.ts"
7+
],
8+
"include": [
9+
"./*.ts"
10+
]
11+
}

0 commit comments

Comments
 (0)