Skip to content

Commit

Permalink
fix(typescript-estree): fix regression introduced in #1525 (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Jan 29, 2020
1 parent 6bebb1d commit bec4572
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions packages/typescript-estree/src/convert.ts
Expand Up @@ -379,10 +379,7 @@ export class Converter {
* property instead of a kind property. Recursively copies all children.
*/
private deeplyCopy(node: TSNode): any {
if (
node.kind >= SyntaxKind.FirstJSDocNode &&
node.kind <= SyntaxKind.LastJSDocNode
) {
if (node.kind === ts.SyntaxKind.JSDocFunctionType) {
throw createError(
this.ast,
node.pos,
Expand Down
5 changes: 3 additions & 2 deletions packages/typescript-estree/tests/lib/convert.ts
Expand Up @@ -239,8 +239,9 @@ describe('convert', () => {

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

for (const code of jsDocCode) {
Expand Down

0 comments on commit bec4572

Please sign in to comment.