Skip to content

Commit

Permalink
Chore: Upgraded deps and added support for typescript v5.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
timocov committed Nov 26, 2023
1 parent c53bd7f commit cff22da
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
"@types/mocha": "~10.0.0",
"@types/node": "~14.18.26",
"@types/yargs": "~17.0.13",
"@typescript-eslint/eslint-plugin": "~6.8.0",
"@typescript-eslint/parser": "~6.8.0",
"eslint": "~8.51.0",
"@typescript-eslint/eslint-plugin": "~6.12.0",
"@typescript-eslint/parser": "~6.12.0",
"eslint": "~8.54.0",
"eslint-plugin-deprecation": "~2.0.0",
"eslint-plugin-import": "~2.28.1",
"eslint-plugin-import": "~2.29.0",
"eslint-plugin-prefer-arrow": "~1.2.1",
"eslint-plugin-unicorn": "~48.0.1",
"eslint-plugin-unicorn": "~49.0.0",
"mocha": "~10.2.0",
"npm-run-all": "~4.1.5",
"rimraf": "~5.0.1",
"ts-compiler": "npm:typescript@5.2.2",
"ts-compiler": "npm:typescript@5.3.2",
"ts-node": "~10.9.1"
},
"license": "MIT",
Expand Down
14 changes: 12 additions & 2 deletions src/helpers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,17 @@ function recreateRootLevelNodeWithModifiersImpl(node: ts.Node, modifiersMap: Mod
}

if (ts.isExportDeclaration(node)) {
interface Ts53CompatExportDeclaration extends ts.ExportDeclaration {
attributes?: ts.ExportDeclaration['assertClause'];
}

return ts.factory.createExportDeclaration(
modifiers,
node.isTypeOnly,
node.exportClause,
node.moduleSpecifier,
node.assertClause
// eslint-disable-next-line deprecation/deprecation
(node as Ts53CompatExportDeclaration).attributes || node.assertClause
);
}

Expand Down Expand Up @@ -415,11 +420,16 @@ function recreateRootLevelNodeWithModifiersImpl(node: ts.Node, modifiersMap: Mod
}

if (ts.isImportDeclaration(node)) {
interface Ts53CompatImportDeclaration extends ts.ImportDeclaration {
attributes?: ts.ImportDeclaration['assertClause'];
}

return ts.factory.createImportDeclaration(
modifiers,
node.importClause,
node.moduleSpecifier,
node.assertClause
// eslint-disable-next-line deprecation/deprecation
(node as Ts53CompatImportDeclaration).attributes || node.assertClause
);
}

Expand Down

0 comments on commit cff22da

Please sign in to comment.