Skip to content

Commit 7e03ec9

Browse files
Bump typescript from 5.9.3 to 6.0.2 (#1476)
* Bump typescript from 5.9.3 to 6.0.2 Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 6.0.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v5.9.3...v6.0.2) --- updated-dependencies: - dependency-name: typescript dependency-version: 6.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fixing configuration for typescript 6 and es2023 * adding a tsconfig just to build the test files * extending `tsconfig.json` instead of copy pasting it. * now that we have 2 configurations for `tsconfig`, we can add back the `eslint` linting for `variant-coverage` that were dismissed because of the single `tsconfig` --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Klaus <[email protected]>
1 parent 0fa85cf commit 7e03ec9

29 files changed

Lines changed: 72 additions & 35 deletions

eslint.config.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const compat = new FlatCompat({
1818
export default [
1919
{
2020
ignores: [
21-
'variant-coverage/**/*.ts',
2221
'coverage/**/*.js',
2322
'dist/**/*.cjs',
2423
'dist/**/*.js',
@@ -72,7 +71,7 @@ export default [
7271
sourceType: 'script',
7372

7473
parserOptions: {
75-
project: ['tsconfig.json']
74+
project: ['tsconfig.test.json']
7675
}
7776
},
7877

package-lock.json

Lines changed: 4 additions & 4 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
@@ -13,7 +13,7 @@
1313
"scripts": {
1414
"build": "webpack --env production",
1515
"build:dev": "webpack --env development",
16-
"build:test": "webpack --config test.config.js",
16+
"build:test": "webpack --config webpack.test.config.js",
1717
"eslint": "eslint 'src/**' 'tests/**'",
1818
"lint": "npm run eslint && npm run prettier -- --list-different && npm run knip",
1919
"lint:fix": "npm run eslint -- --fix && npm run prettier -- --write",
@@ -110,7 +110,7 @@
110110
"solc": "^0.8.34",
111111
"ts-loader": "^9.5.7",
112112
"ts-node": "^10.9.2",
113-
"typescript": "^5.9.3",
113+
"typescript": "^6.0.2",
114114
"webpack": "^5.105.4",
115115
"webpack-cli": "^7.0.2"
116116
},

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,

tsconfig.test.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "./"
5+
},
6+
"include": ["./src/**/*", "./variant-coverage/**/*"]
7+
}

variant-coverage/ArgumentsDeclaration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export function checkArgumentsDeclarationVariant(
77
): void {
88
if (variant instanceof ast.PositionalArgumentsDeclaration) return;
99
if (variant instanceof ast.NamedArgumentsDeclaration) return;
10-
/* c8 ignore next 2 */
10+
/* c8 ignore next 3 */
1111
const _exhaustiveCheck: never = variant;
12+
return _exhaustiveCheck;
1213
}

variant-coverage/ContractMember.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function checkContractMemberVariant(
1717
if (variant instanceof ast.StateVariableDefinition) return;
1818
if (variant instanceof ast.ErrorDefinition) return;
1919
if (variant instanceof ast.UserDefinedValueTypeDefinition) return;
20-
/* c8 ignore next 2 */
20+
/* c8 ignore next 3 */
2121
const _exhaustiveCheck: never = variant;
22+
return _exhaustiveCheck;
2223
}

variant-coverage/ContractSpecifier.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export function checkContractSpecifierVariant(
66
): void {
77
if (variant instanceof ast.InheritanceSpecifier) return;
88
if (variant instanceof ast.StorageLayoutSpecifier) return;
9-
/* c8 ignore next 2 */
9+
/* c8 ignore next 3 */
1010
const _exhaustiveCheck: never = variant;
11+
return _exhaustiveCheck;
1112
}

variant-coverage/Expression.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export function checkExpressionVariant(
3333
if (variant instanceof ast.DecimalNumberExpression) return;
3434
if (variant instanceof ast.StringExpression) return;
3535
if (variant instanceof ast.ElementaryType) return;
36-
/* c8 ignore next 2 */
36+
/* c8 ignore next 3 */
3737
const _exhaustiveCheck: never = variant;
38+
return _exhaustiveCheck;
3839
}

0 commit comments

Comments
 (0)