Skip to content

Commit 3280a4a

Browse files
committed
Fix webviews rule
1 parent 3e88941 commit 3280a4a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

build/eslint-rules/public-methods-well-defined-types.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ module.exports = {
5959

6060
// Type references with inline type arguments: Promise<{x: string}>, Array<{y: number}>
6161
case 'TSTypeReference':
62-
// Check if any type arguments contain inline types
63-
if (typeNode.typeParameters && typeNode.typeParameters.params) {
64-
return typeNode.typeParameters.params.some(isInlineType);
62+
// ESLint 9 / @typescript-eslint v8 may expose generic instantiations on `typeArguments` instead of `typeParameters`.
63+
// Support both shapes defensively.
64+
const typeArgs = typeNode.typeParameters || typeNode.typeArguments;
65+
if (typeArgs && typeArgs.params) {
66+
return typeArgs.params.some(isInlineType);
6567
}
6668
return false;
6769

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4194,7 +4194,7 @@
41944194
"watch:test": "tsc -w -p tsconfig.test.json",
41954195
"compile:node": "webpack --mode development --config-name extension:node --config-name webviews",
41964196
"compile:web": "webpack --mode development --config-name extension:webworker --config-name webviews",
4197-
"lint": "eslint --fix --cache",
4197+
"lint": "eslint --fix --cache . --ext .ts,.tsx",
41984198
"package": "npx vsce package --yarn",
41994199
"test": "yarn run test:preprocess && node ./out/src/test/runTests.js",
42004200
"test:preprocess": "yarn run compile:test && yarn run test:preprocess-gql && yarn run test:preprocess-svg && yarn run test:preprocess-fixtures",

0 commit comments

Comments
 (0)