Skip to content

Commit bec4572

Browse files
authored
fix(typescript-estree): fix regression introduced in typescript-eslint#1525 (typescript-eslint#1543)
1 parent 6bebb1d commit bec4572

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/typescript-estree/src/convert.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,7 @@ export class Converter {
379379
* property instead of a kind property. Recursively copies all children.
380380
*/
381381
private deeplyCopy(node: TSNode): any {
382-
if (
383-
node.kind >= SyntaxKind.FirstJSDocNode &&
384-
node.kind <= SyntaxKind.LastJSDocNode
385-
) {
382+
if (node.kind === ts.SyntaxKind.JSDocFunctionType) {
386383
throw createError(
387384
this.ast,
388385
node.pos,

packages/typescript-estree/tests/lib/convert.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@ describe('convert', () => {
239239

240240
it('should throw error on jsDoc node', () => {
241241
const jsDocCode = [
242-
'type foo = ?foo<T> | ?(() => void)?',
243-
'var a: function(b): c;',
242+
'const x: function(new: number, string);',
243+
'const x: function(this: number, string);',
244+
'var g: function(number, number): number;',
244245
];
245246

246247
for (const code of jsDocCode) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy