Skip to content

Commit aa67ca3

Browse files
authored
Update @typescript-eslint/parser to v8.48 (#2834)
1 parent 994e31c commit aa67ca3

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
"@babel/eslint-parser": "^7.28.5",
8181
"@eslint/eslintrc": "^3.3.1",
8282
"@lubien/fixture-beta-package": "^1.0.0-beta.1",
83-
"@typescript-eslint/parser": "^8.46.2",
84-
"@typescript-eslint/types": "^8.46.2",
83+
"@typescript-eslint/parser": "^8.48.0",
84+
"@typescript-eslint/types": "^8.48.0",
8585
"ava": "^6.4.1",
8686
"c8": "^10.1.3",
8787
"enquirer": "^2.4.1",

rules/prefer-node-protocol.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const create = context => {
2121
node.parent.type === 'ImportDeclaration'
2222
|| node.parent.type === 'ExportNamedDeclaration'
2323
|| node.parent.type === 'ImportExpression'
24+
|| node.parent.type === 'TSImportType'
2425
)
2526
&& node.parent.source === node
2627
)
@@ -37,12 +38,6 @@ const create = context => {
3738
)
3839
&& node.parent.arguments[0] === node
3940
)
40-
|| (
41-
node.parent.type === 'TSLiteralType'
42-
&& node.parent.literal === node
43-
&& node.parent.parent.type === 'TSImportType'
44-
&& node.parent.parent.argument === node.parent
45-
)
4641
)) {
4742
return;
4843
}

rules/prefer-string-raw.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ function isStringRawRestricted(node) {
6767
|| (type === 'TSExternalModuleReference' && parent.expression === node)
6868
// (TypeScript) Literal type
6969
|| (type === 'TSLiteralType' && parent.literal === node)
70+
// (TypeScript) Import type
71+
|| (type === 'TSImportType' && parent.source === node)
7072
);
7173
}
7274

test/prefer-string-raw.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ test.snapshot({
139139
String.raw`import type T = require('${TEST_STRING}');`,
140140
// (TypeScript) Literal type
141141
String.raw`type T = '${TEST_STRING}';`,
142+
// (TypeScript) Import type
143+
String.raw`type T = import('${TEST_STRING}');`,
142144
...keyTestsComputedIsInvalid,
143145
...keyTestsComputedIsValid.flatMap(code => [code, toComputed(code)]),
144146
`expect(foo).toMatchInlineSnapshot('${TEST_STRING}')`,

0 commit comments

Comments
 (0)