Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all type errors #1967

Closed
wants to merge 13 commits into from
Closed
Next Next commit
Fix typescript-checkJS script
  • Loading branch information
aweebit committed Aug 13, 2023
commit 5c5c9726c6c71cf2a53f67183ea5e16864a77c26
2 changes: 2 additions & 0 deletions lib/suggestSimilar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

const maxDistance = 3;

function editDistance(a, b) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "jest && npm run test-typings",
"test-esm": "node ./tests/esm-imports-test.mjs",
"test-typings": "tsd",
"typescript-checkJS": "tsc --allowJS --checkJS index.js lib/*.js --noEmit",
"typescript-checkJS": "tsc -p tsconfig.checkJs.json",
"test-all": "npm run test && npm run lint && npm run typescript-checkJS && npm run test-esm"
},
"files": [
Expand Down
14 changes: 14 additions & 0 deletions tsconfig.checkJs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noImplicitAny": false,
"noImplicitThis": false
},
"include": [
"**/*.ts",
"index.js",
"lib/**/*.js"
]
}
34 changes: 18 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"types": [
"node",
"jest"
],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"include": ["**/*.ts"],
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"types": [
"node",
"jest"
],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"include": [
"**/*.ts"
]
}