Skip to content

Commit b677f76

Browse files
committed
fixing configuration for typescript 6 and es2023
1 parent 927d086 commit b677f76

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
"@types/jest": "^30.0.0",
9191
"@types/node": "^25.5.0",
9292
"@types/semver": "^7.7.1",
93-
"@typescript-eslint/eslint-plugin": "^8.57.2",
94-
"@typescript-eslint/parser": "^8.57.2",
93+
"@typescript-eslint/eslint-plugin": "^8.58.0",
94+
"@typescript-eslint/parser": "^8.58.0",
9595
"c8": "^11.0.0",
9696
"cross-env": "^10.1.0",
9797
"eslint": "^9.39.4",

src/slangPrinter.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function hasNodeIgnoreComment({ comments }: StrictAstNode): boolean {
2222
);
2323
}
2424

25-
function ignoreComments(path: AstPath<AstNode>): void {
25+
function ignoreComments(path: AstPath<StrictAstNode>): void {
2626
const node = path.node;
2727
// We ignore anything that is not an object
2828
if (node === null || typeof node !== 'object') return;
@@ -38,15 +38,17 @@ function ignoreComments(path: AstPath<AstNode>): void {
3838
break;
3939
// The key `comments` will contain every comment for this node.
4040
case 'comments':
41-
path.each((commentPath) => (commentPath.node.printed = true), key);
41+
if (node.comments !== undefined) {
42+
path.each((commentPath) => (commentPath.node.printed = true), key);
43+
}
4244
break;
4345
default:
4446
// If the value for that key is an Array or an Object we go deeper.
4547
const childNode = node[key];
4648
if (typeof childNode === 'object') {
4749
if (Array.isArray(childNode)) {
4850
path.each(ignoreComments, key);
49-
return;
51+
break;
5052
}
5153
path.call(ignoreComments, key);
5254
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"compilerOptions": {
33
"allowJs": true,
4+
"rootDir": "./src",
45
"outDir": "./dist/",
56
"noImplicitAny": true,
67
"strictPropertyInitialization": true,
78
"sourceMap": true,
8-
"target": "es6",
9+
"target": "es2023",
910
"module": "NodeNext",
1011
"moduleResolution": "NodeNext",
1112
"strict": true,

0 commit comments

Comments
 (0)