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 broken typescript-checkJS script. Store config for the script in jsconfig.json so that it is picked up by VS Code #1962

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const javascriptSettings = {
const typescriptSettings = {
files: ['*.ts', '*.mts'],
parserOptions: {
project: './tsconfig.json'
project: './tsconfig.base.json'
},
plugins: [
'@typescript-eslint'
Expand Down
14 changes: 14 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.base",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noImplicitAny": false,
"noImplicitThis": false
},
"include": [
"**/*.ts",
"index.js",
"lib/**/*.js"
]
}
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 jsconfig.json",
"test-all": "npm run test && npm run lint && npm run typescript-checkJS && npm run test-esm"
},
"files": [
Expand Down
20 changes: 20 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"types": [
"node",
"jest"
],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"include": [
"**/*.ts"
]
}
18 changes: 0 additions & 18 deletions tsconfig.json

This file was deleted.