Skip to content

Commit

Permalink
Add strict-type check to pre test for select files
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonE committed Sep 25, 2023
1 parent 81bf12a commit aad4d7b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions config/tsconfig-strict.json
@@ -0,0 +1,11 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"strict": true, // Enable all strict type-checking options.
},
"include": [],
"files": [
"../src/ol/math.js"
// Slowly growing list of strict check files goes here
]
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -11,7 +11,7 @@
"homepage": "https://openlayers.org/",
"scripts": {
"lint": "eslint tasks test src/ol examples config",
"pretest": "npm run lint && npm run typecheck",
"pretest": "npm run lint && npm run typecheck && npm run typecheck-strict",
"test-rendering": "npm run build-full && node test/rendering/test.js",
"test-browser": "npm run karma -- --single-run --log-level error",
"test-node": "mocha --recursive test/node",
Expand All @@ -27,6 +27,7 @@
"generate-types": "tsc --project config/tsconfig-build.json --declaration --declarationMap --emitDeclarationOnly --outdir build/ol",
"transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build && node tasks/serialize-workers.cjs && node tasks/set-version.js",
"typecheck": "tsc --pretty",
"typecheck-strict": "tsc --project config/tsconfig-strict.json",
"apidoc-debug": "shx rm -rf build/apidoc && node --inspect-brk=9229 ./node_modules/jsdoc/jsdoc.js --readme config/jsdoc/api/index.md --configure config/jsdoc/api/conf.json --package package.json --destination build/apidoc",
"apidoc": "shx rm -rf build/apidoc && jsdoc --readme config/jsdoc/api/index.md --configure config/jsdoc/api/conf.json --package package.json --destination build/apidoc"
},
Expand Down
2 changes: 1 addition & 1 deletion src/ol/math.js
Expand Up @@ -60,7 +60,7 @@ export function squaredDistance(x1, y1, x2, y2) {
*
* @param {Array<Array<number>>} mat Augmented matrix (n x n + 1 column)
* in row-major order.
* @return {Array<number>} The resulting vector.
* @return {Array<number>|null} The resulting vector.
*/
export function solveLinearSystem(mat) {
const n = mat.length;
Expand Down

0 comments on commit aad4d7b

Please sign in to comment.