File tree 2 files changed +4
-6
lines changed
packages/typescript-estree
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -379,10 +379,7 @@ export class Converter {
379
379
* property instead of a kind property. Recursively copies all children.
380
380
*/
381
381
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 ) {
386
383
throw createError (
387
384
this . ast ,
388
385
node . pos ,
Original file line number Diff line number Diff line change @@ -239,8 +239,9 @@ describe('convert', () => {
239
239
240
240
it ( 'should throw error on jsDoc node' , ( ) => {
241
241
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;' ,
244
245
] ;
245
246
246
247
for ( const code of jsDocCode ) {
You can’t perform that action at this time.
0 commit comments