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

chore: upgrade to typescript 5 #5473

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
106 changes: 79 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"build-cli:prod": "node --max-old-space-size=8192 node_modules/webpack/bin/webpack.js --config webpack.prod.ts",
"watch": "npm run build-cli:dev -- --watch",
"test": "npm run test:unit && npm run test:acceptance && npm run test:tap",
"test:tsc": "tsc --noEmit",
"test:unit": "jest --runInBand --testPathPattern '/test(/jest)?/unit/' --reporters=jest-junit",
"test:acceptance": "jest --maxWorkers=1 --testPathPattern \"/test(/jest)?/acceptance/\" --reporters=jest-junit",
"test:tap": "tap -Rspec --timeout=300 test/tap/*.test.* ",
Expand Down Expand Up @@ -136,7 +137,9 @@
"wrap-ansi": "^5.1.0"
},
"devDependencies": {
"@types/abbrev": "^1.1.5",
"@types/body-parser": "^1.19.1",
"@types/chalk": "^2.2.0",
"@types/cross-spawn": "^6.0.2",
"@types/express": "^4.17.13",
"@types/fs-extra": "^9.0.11",
Expand Down Expand Up @@ -177,7 +180,7 @@
"ts-jest": "29.1.2",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5",
"typescript": "^5.5.0",
"vscode-jsonrpc": "8.1.0",
"webpack": "^5.54.0",
"webpack-cli": "^4.6.0",
Expand Down
12 changes: 12 additions & 0 deletions src/cli/commands/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ export default async function test(
// Note: this is done based on the logic done below
// for non-json/sarif outputs, where we take the code of
// the first error.
// TODO: refactor this to be more consistent
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: broken type definitions
err.code = errorResults[0].code;
}
err.json = stringifiedData;
Expand Down Expand Up @@ -290,13 +293,22 @@ export default async function test(
if (notSuccess) {
response += chalk.bold.red(summaryMessage);
const error = new Error(response) as any;
// TODO: refactor this to be more consistent
// take the code of the first problem to go through error
// translation
// HACK as there can be different errors, and we pass only the
// first one
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: broken type definitions
error.code = errorResults[0].code;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: broken type definitions
error.userMessage = errorResults[0].userMessage;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: broken type definitions
error.strCode = errorResults[0].strCode;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: broken type definitions
error.innerError = errorResults[0].innerError;
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export async function main(): Promise<void> {

if (
typeof globalArgs.options.detectionDepth !== 'undefined' &&
(globalArgs.options.detectionDepth <= 0 ||
((globalArgs.options.detectionDepth as number) <= 0 ||
Number.isNaN(globalArgs.options.detectionDepth))
) {
throw new InvalidDetectionDepthValue();
Expand Down
Loading