From 34d3765869f82d168c42f1d887e04af8db5b0ad4 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 17 Dec 2022 22:57:10 -0500 Subject: [PATCH 01/15] wip: throw on invalid tokens --- packages/typescript-estree/src/convert.ts | 35 +++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 4af9163c34e..bf2f65b61f9 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -238,6 +238,23 @@ export class Converter { return this.converter(child, parent, this.inTypeMode, false); } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + private convertChildNonNull( + child: ts.Node | undefined, + parent: ts.Node, + message: string, + ): any | null { + if (!child) { + throw createError(this.ast, parent.pos, message); + } + return this.converter(child, parent, this.inTypeMode, false); + } + /** * Converts a TypeScript node into an ESTree node. * @param child the child ts.Node @@ -851,7 +868,11 @@ export class Converter { case SyntaxKind.ThrowStatement: return this.createNode(node, { type: AST_NODE_TYPES.ThrowStatement, - argument: this.convertChild(node.expression), + argument: this.convertChildNonNull( + node.expression, + node, + 'A throw statement must throw an argument.', + ), }); case SyntaxKind.TryStatement: @@ -991,6 +1012,12 @@ export class Converter { kind: getDeclarationKind(node.declarationList), }); + if (result.declarations.length) { + throw createError( + 'A variable declaration list must have at least one variable declarator.', + ); + } + /** * Semantically, decorators are not allowed on variable declarations, * Pre 4.8 TS would include them in the AST, so we did as well. @@ -1743,7 +1770,11 @@ export class Converter { const result = this.createNode(node, { type: AST_NODE_TYPES.ImportDeclaration, - source: this.convertChild(node.moduleSpecifier), + source: this.convertChildNonNull( + node.moduleSpecifier, + node, + 'An import statement must import an argument.', + ), specifiers: [], importKind: 'value', assertions: this.convertAssertClasue(node.assertClause), From 081bf03c2f6f0c9a54c6435e7361a59937bcc23e Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 23 Dec 2022 17:19:46 -0500 Subject: [PATCH 02/15] Added option and tests --- docs/architecture/TypeScript-ESTree.mdx | 12 ++- packages/parser/tests/lib/parser.ts | 4 +- .../typescript-estree/src/ast-converter.ts | 1 + packages/typescript-estree/src/convert.ts | 45 ++++++----- packages/typescript-estree/src/node-utils.ts | 7 ++ .../src/parseSettings/createParseSettings.ts | 1 + .../src/parseSettings/index.ts | 5 ++ .../typescript-estree/src/parser-options.ts | 10 +++ .../tests/lib/convert.test.ts | 75 ++++++++++++------- .../website/src/components/linter/config.ts | 2 +- 10 files changed, 109 insertions(+), 53 deletions(-) diff --git a/docs/architecture/TypeScript-ESTree.mdx b/docs/architecture/TypeScript-ESTree.mdx index 3f488eb04ba..de929e973f7 100644 --- a/docs/architecture/TypeScript-ESTree.mdx +++ b/docs/architecture/TypeScript-ESTree.mdx @@ -48,6 +48,16 @@ interface ParseOptions { */ debugLevel?: boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; + /** + * Causes the parser to an error if it receives an invalid AST from TypeScript. + * This case only usually occurs when attempting to lint invalid code. + * + * @remarks + * This is because TypeScript reports some syntax issues as semantic diagnostics. + * See https://github.com/typescript-eslint/typescript-eslint/issues/1852. + */ + errorOnInvalidAST?: boolean; + /** * Cause the parser to error if it encounters an unknown AST node type (useful for testing). * This case only usually occurs when TypeScript releases new features. @@ -99,7 +109,7 @@ interface ParseOptions { const PARSE_DEFAULT_OPTIONS: ParseOptions = { comment: false, - errorOnUnknownASTType: false, + filePath: 'estree.ts', // or 'estree.tsx', if you pass jsx: true jsx: false, loc: false, diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index e554c4bfde7..c5526dda32d 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -35,7 +35,7 @@ describe('parser', () => { // ts-estree specific filePath: 'isolated-file.src.ts', project: 'tsconfig.json', - errorOnUnknownASTType: false, + errorOnTypeScriptSyntacticAndSemanticIssues: false, tsconfigRootDir: 'tests/fixtures/services', extraFileExtensions: ['.foo'], @@ -89,7 +89,7 @@ describe('parser', () => { // ts-estree specific filePath: 'isolated-file.src.ts', project: 'tsconfig.json', - errorOnUnknownASTType: false, + errorOnTypeScriptSyntacticAndSemanticIssues: false, tsconfigRootDir: 'tests/fixtures/services', extraFileExtensions: ['.foo'], diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 0e55541969d..fceaff03aef 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -26,6 +26,7 @@ export function astConverter( * Recursively convert the TypeScript AST into an ESTree-compatible AST */ const instance = new Converter(ast, { + errorOnInvalidAST: parseSettings.errorOnInvalidAST || false, errorOnUnknownASTType: parseSettings.errorOnUnknownASTType || false, shouldPreserveNodeMaps, }); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index bf2f65b61f9..a0e087ece8c 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -24,6 +24,7 @@ import { isESTreeClassMember, isOptional, isThisInTypeQuery, + nodeHasIllegalDecorators, unescapeStringLiteralText, } from './node-utils'; import type { @@ -37,8 +38,9 @@ import { AST_NODE_TYPES } from './ts-estree'; const SyntaxKind = ts.SyntaxKind; interface ConverterOptions { - errorOnUnknownASTType: boolean; - shouldPreserveNodeMaps: boolean; + errorOnInvalidAST?: boolean; + errorOnUnknownASTType?: boolean; + shouldPreserveNodeMaps?: boolean; } /** @@ -76,7 +78,7 @@ export class Converter { * @param options additional options for the conversion * @returns the converted ESTreeNode */ - constructor(ast: ts.SourceFile, options: ConverterOptions) { + constructor(ast: ts.SourceFile, options: ConverterOptions = {}) { this.ast = ast; this.options = { ...options }; } @@ -239,17 +241,16 @@ export class Converter { } /** - * Converts a TypeScript node into an ESTree node. - * @param child the child ts.Node - * @param parent parentNode - * @returns the converted ESTree node + * Converts a TypeScript child node into an ESTree node, throwing an error + * if the child is not defined and options.errorOnInvalidAST is true. + * @returns The converted ESTree node. */ - private convertChildNonNull( + private convertChildStrict( child: ts.Node | undefined, parent: ts.Node, message: string, ): any | null { - if (!child) { + if (!child && this.options.errorOnInvalidAST) { throw createError(this.ast, parent.pos, message); } return this.converter(child, parent, this.inTypeMode, false); @@ -868,11 +869,7 @@ export class Converter { case SyntaxKind.ThrowStatement: return this.createNode(node, { type: AST_NODE_TYPES.ThrowStatement, - argument: this.convertChildNonNull( - node.expression, - node, - 'A throw statement must throw an argument.', - ), + argument: this.convertChild(node.expression), }); case SyntaxKind.TryStatement: @@ -1004,6 +1001,8 @@ export class Converter { } case SyntaxKind.VariableStatement: { + this.#checkIllegalDecorators(node); + const result = this.createNode(node, { type: AST_NODE_TYPES.VariableDeclaration, declarations: node.declarationList.declarations.map(el => @@ -1012,8 +1011,10 @@ export class Converter { kind: getDeclarationKind(node.declarationList), }); - if (result.declarations.length) { + if (this.options.errorOnInvalidAST && !result.declarations.length) { throw createError( + this.ast, + node.pos, 'A variable declaration list must have at least one variable declarator.', ); } @@ -1770,11 +1771,7 @@ export class Converter { const result = this.createNode(node, { type: AST_NODE_TYPES.ImportDeclaration, - source: this.convertChildNonNull( - node.moduleSpecifier, - node, - 'An import statement must import an argument.', - ), + source: this.convertChild(node.moduleSpecifier), specifiers: [], importKind: 'value', assertions: this.convertAssertClasue(node.assertClause), @@ -2726,6 +2723,8 @@ export class Converter { } case SyntaxKind.EnumDeclaration: { + this.#checkIllegalDecorators(node); + const result = this.createNode(node, { type: AST_NODE_TYPES.TSEnumDeclaration, id: this.convertChild(node.name), @@ -2953,4 +2952,10 @@ export class Converter { return this.deeplyCopy(node); } } + + #checkIllegalDecorators(node: ts.Node): void { + if (this.options.errorOnInvalidAST && nodeHasIllegalDecorators(node)) { + throw createError(this.ast, node.pos, 'Decorators are not valid here.'); + } + } } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 929d63cfcdf..5526acbf5c8 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -628,6 +628,13 @@ export function createError( return new TSError(message, ast.fileName, start, loc.line + 1, loc.character); } +export function nodeHasIllegalDecorators(node: ts.Node): boolean { + return !!( + 'illegalDecorators' in node && + (node.illegalDecorators as unknown[] | undefined)?.length + ); +} + /** * @param n the TSNode * @param ast the TS AST diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 767e4af8e97..ea42228640c 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -41,6 +41,7 @@ export function createParseSettings( : Array.isArray(options.debugLevel) ? new Set(options.debugLevel) : new Set(), + errorOnInvalidAST: options.errorOnInvalidAST === true, errorOnTypeScriptSyntacticAndSemanticIssues: false, errorOnUnknownASTType: options.errorOnUnknownASTType === true, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: diff --git a/packages/typescript-estree/src/parseSettings/index.ts b/packages/typescript-estree/src/parseSettings/index.ts index 07e818ae988..2fe99fe3308 100644 --- a/packages/typescript-estree/src/parseSettings/index.ts +++ b/packages/typescript-estree/src/parseSettings/index.ts @@ -41,6 +41,11 @@ export interface MutableParseSettings { */ debugLevel: Set; + /** + * Whether to throw an error when a required node child does not exist. + */ + errorOnInvalidAST: boolean; + /** * Whether to error if TypeScript reports a semantic or syntactic error diagnostic. */ diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 3ce40281f94..a60e9ba30da 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -25,6 +25,16 @@ interface ParseOptions { */ debugLevel?: DebugLevel; + /** + * Causes the parser to an error if it sees that a required node child does not exist. + * This case only usually occurs when attempting to lint invalid code. + * + * @remarks + * This is because TypeScript reports some syntax issues as semantic diagnostics. + * See https://github.com/typescript-eslint/typescript-eslint/issues/1852. + */ + errorOnInvalidAST?: boolean; + /** * Cause the parser to error if it encounters an unknown AST node type (useful for testing). * This case only usually occurs when TypeScript releases new features. diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index fb3ac3f6313..3222265e60e 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -26,20 +26,14 @@ describe('convert', () => { ts.forEachChild(ast, fakeUnknownKind); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect(instance.convertProgram()).toMatchSnapshot(); }); it('deeplyCopy should convert node with decorators correctly', () => { const ast = convertCode('@test class foo {}'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect( instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), @@ -49,10 +43,7 @@ describe('convert', () => { it('deeplyCopy should convert node with type parameters correctly', () => { const ast = convertCode('class foo {}'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect( instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), @@ -62,10 +53,7 @@ describe('convert', () => { it('deeplyCopy should convert node with type arguments correctly', () => { const ast = convertCode('new foo()'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect( instance['deeplyCopy']( @@ -78,10 +66,7 @@ describe('convert', () => { it('deeplyCopy should convert array of nodes', () => { const ast = convertCode('new foo()'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect(instance['deeplyCopy'](ast)).toMatchSnapshot(); }); @@ -90,7 +75,6 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: true, - shouldPreserveNodeMaps: false, }); expect(() => instance['deeplyCopy'](ast)).toThrow( @@ -107,7 +91,6 @@ describe('convert', () => { `); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); instance.convertProgram(); @@ -140,7 +123,6 @@ describe('convert', () => { const ast = convertCode(``); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); instance.convertProgram(); @@ -172,7 +154,6 @@ describe('convert', () => { const ast = convertCode(`export function foo () {}`); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); const program = instance.convertProgram(); @@ -203,7 +184,6 @@ describe('convert', () => { it('should correctly create node with range and loc set', () => { const ast = convertCode(''); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); @@ -252,13 +232,50 @@ describe('convert', () => { for (const code of jsDocCode) { const ast = convertCode(code); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect(() => instance.convertProgram()).toThrow( 'JSDoc types can only be used inside documentation comments.', ); } }); + + describe('errorOnInvalidAST', () => { + function generateTest(title: string, code: string, error: string): void { + it(`does not throw an error for ${title} when errorOnInvalidAST is false`, () => { + const ast = convertCode(code); + + const instance = new Converter(ast); + + expect(() => instance.convertProgram()).not.toThrow(); + }); + + it(`throws an error for ${title} when errorOnInvalidAST is true`, () => { + const ast = convertCode(code); + + const instance = new Converter(ast, { + errorOnInvalidAST: true, + }); + + expect(() => instance.convertProgram()).toThrow(error); + }); + } + + generateTest( + 'a decorator on an enum declaration', + '@decl let value;', + 'Decorators are not valid here.', + ); + + generateTest( + 'a decorator on a variable statement', + '@decl let value;', + 'Decorators are not valid here.', + ); + + generateTest( + 'a variable declaration with no variables', + 'const;', + 'A variable declaration list must have at least one variable declarator.', + ); + }); }); diff --git a/packages/website/src/components/linter/config.ts b/packages/website/src/components/linter/config.ts index 2dc3eaa0d7c..506f3952a2f 100644 --- a/packages/website/src/components/linter/config.ts +++ b/packages/website/src/components/linter/config.ts @@ -7,7 +7,7 @@ export const parseSettings: ParseSettings = { comments: [], DEPRECATED__createDefaultProgram: false, debugLevel: new Set(), - errorOnUnknownASTType: false, + extraFileExtensions: [], filePath: '', jsx: false, From e2684df09892ca948c14248a76ba65024c26914f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 23 Dec 2022 17:21:37 -0500 Subject: [PATCH 03/15] More decorator checking --- packages/typescript-estree/src/convert.ts | 4 ++++ packages/typescript-estree/tests/lib/convert.test.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index a0e087ece8c..609571274bb 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2477,6 +2477,8 @@ export class Converter { return this.convertChild(node.expression, parent); case SyntaxKind.TypeAliasDeclaration: { + this.#checkIllegalDecorators(node); + const result = this.createNode(node, { type: AST_NODE_TYPES.TSTypeAliasDeclaration, id: this.convertChild(node.name), @@ -2633,6 +2635,8 @@ export class Converter { } case SyntaxKind.InterfaceDeclaration: { + this.#checkIllegalDecorators(node); + const interfaceHeritageClauses = node.heritageClauses ?? []; const result = this.createNode(node, { type: AST_NODE_TYPES.TSInterfaceDeclaration, diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 3222265e60e..fcbfa1cf143 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -266,6 +266,18 @@ describe('convert', () => { 'Decorators are not valid here.', ); + generateTest( + 'a decorator on an interface declaration', + '@decl interface _ {};', + 'Decorators are not valid here.', + ); + + generateTest( + 'a decorator on a type alias declaration', + '@decl type _ = {};', + 'Decorators are not valid here.', + ); + generateTest( 'a decorator on a variable statement', '@decl let value;', From 65685220e44e5724e46d6749541cd617db14792c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 23 Dec 2022 17:43:01 -0500 Subject: [PATCH 04/15] A few more cases --- packages/typescript-estree/src/convert.ts | 12 ++++++++++++ packages/typescript-estree/tests/lib/convert.test.ts | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 609571274bb..4a5c6c4aca5 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1673,6 +1673,18 @@ export class Converter { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: { + if ( + this.options.errorOnInvalidAST && + node.modifiers?.length === 1 && + node.modifiers[0].kind === ts.SyntaxKind.ExportKeyword + ) { + throw createError( + this.ast, + node.pos, + "A class declaration without the 'default' modifier must have a name.", + ); + } + const heritageClauses = node.heritageClauses ?? []; const classNodeType = node.kind === SyntaxKind.ClassDeclaration diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index fcbfa1cf143..d4abdb82801 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -284,6 +284,12 @@ describe('convert', () => { 'Decorators are not valid here.', ); + generateTest( + 'an exported class declaration without a name', + 'export class { }', + "A class declaration without the 'default' modifier must have a name.", + ); + generateTest( 'a variable declaration with no variables', 'const;', From 40cf6b2f966e0f84c7961c16c82e086beceadf90 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 6 Feb 2023 07:07:37 -0500 Subject: [PATCH 05/15] Account for a few more cases --- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures-with-differences-errors.shot | 2 + packages/typescript-estree/src/convert.ts | 62 +++-- .../tests/ast-alignment/parse.ts | 1 + .../tests/lib/convert.test.ts | 6 + ...nvalid-class-two-super-classes.src.js.shot | 242 ++++++++++++++++- .../error-dynamic-import-params.src.js.shot | 243 ++++++++++++++++- ...nvalid-export-module-specifier.src.js.shot | 247 +++++++++++++++++- ...mport-default-module-specifier.src.js.shot | 191 +++++++++++++- ...nvalid-import-module-specifier.src.js.shot | 229 +++++++++++++++- 13 files changed, 1182 insertions(+), 49 deletions(-) diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot index bcf5b40695c..c01d828d2c5 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source TSESTree - Error 1`] = `[TSError: Module specifier must be a string literal.]`; +exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot index 3a1a419a831..6917637d914 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot index 4cfff84fd98..fb74333f793 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source TSESTree - Error 1`] = `[TSError: Module specifier must be a string literal.]`; +exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot index 0d5964ffc24..9c5c8d2bd78 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index ad9289156df..5108b45d1ae 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -7,10 +7,12 @@ Object { "declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/kind-type/fixture.ts", + "declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts", "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts", + "declaration/ImportDeclaration/fixtures/_error_/non-string-source/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 2cc3d546b0a..affa3083c58 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -706,8 +706,7 @@ export class Converter { allowNull: boolean, ): void { if (!allowNull && node.moduleSpecifier == null) { - throw createError( - this.ast, + this.#throwIfErrorOnInvalidAST( node.pos, 'Module specifier must be a string literal.', ); @@ -717,8 +716,7 @@ export class Converter { node.moduleSpecifier && node.moduleSpecifier?.kind !== SyntaxKind.StringLiteral ) { - throw createError( - this.ast, + this.#throwIfErrorOnInvalidAST( node.moduleSpecifier.pos, 'Module specifier must be a string literal.', ); @@ -839,6 +837,13 @@ export class Converter { // Exceptions case SyntaxKind.ThrowStatement: + if (node.expression.end === node.expression.pos) { + this.#throwIfErrorOnInvalidAST( + node.pos, + 'A throw statement must throw an expression.', + ); + } + return this.createNode(node, { type: AST_NODE_TYPES.ThrowStatement, argument: this.convertChild(node.expression), @@ -983,9 +988,8 @@ export class Converter { kind: getDeclarationKind(node.declarationList), }); - if (this.options.errorOnInvalidAST && !result.declarations.length) { - throw createError( - this.ast, + if (!result.declarations.length) { + this.#throwIfErrorOnInvalidAST( node.pos, 'A variable declaration list must have at least one variable declarator.', ); @@ -1227,6 +1231,18 @@ export class Converter { } else { // class + if ( + !node.body && + !node.questionToken && + !hasModifier(ts.SyntaxKind.AbstractKeyword, node) && + !hasModifier(ts.SyntaxKind.AbstractKeyword, node.parent) + ) { + this.#throwIfErrorOnInvalidAST( + node.name.pos, + 'Function implementation is missing or not immediately following the declaration.', + ); + } + /** * Unlike in object literal methods, class method params can have decorators */ @@ -1639,19 +1655,18 @@ export class Converter { // Classes case SyntaxKind.ClassDeclaration: - case SyntaxKind.ClassExpression: { if ( - this.options.errorOnInvalidAST && - node.modifiers?.length === 1 && - node.modifiers[0].kind === ts.SyntaxKind.ExportKeyword + !node.name && + (!hasModifier(ts.SyntaxKind.ExportKeyword, node) || + !hasModifier(ts.SyntaxKind.DefaultKeyword, node)) ) { - throw createError( - this.ast, + this.#throwIfErrorOnInvalidAST( node.pos, "A class declaration without the 'default' modifier must have a name.", ); } - + /* intentional fallthrough */ + case SyntaxKind.ClassExpression: { const heritageClauses = node.heritageClauses ?? []; const classNodeType = node.kind === SyntaxKind.ClassDeclaration @@ -1683,8 +1698,7 @@ export class Converter { if (superClass) { if (superClass.types.length > 1) { - throw createError( - this.ast, + this.#throwIfErrorOnInvalidAST( superClass.types[1].pos, 'Classes can only extend a single class.', ); @@ -2011,8 +2025,7 @@ export class Converter { case SyntaxKind.CallExpression: { if (node.expression.kind === SyntaxKind.ImportKeyword) { if (node.arguments.length !== 1 && node.arguments.length !== 2) { - throw createError( - this.ast, + this.#throwIfErrorOnInvalidAST( node.arguments.pos, 'Dynamic import requires exactly one or two arguments.', ); @@ -2938,8 +2951,17 @@ export class Converter { } #checkIllegalDecorators(node: ts.Node): void { - if (this.options.errorOnInvalidAST && nodeHasIllegalDecorators(node)) { - throw createError(this.ast, node.pos, 'Decorators are not valid here.'); + if (nodeHasIllegalDecorators(node)) { + this.#throwIfErrorOnInvalidAST( + node.pos, + 'Decorators are not valid here.', + ); + } + } + + #throwIfErrorOnInvalidAST(pos: number, message: string): void { + if (this.options.errorOnInvalidAST) { + throw createError(this.ast, pos, message); } } } diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 5837090f47a..f8020060352 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -64,6 +64,7 @@ function parseWithTypeScriptESTree(text: string, jsx = true): AST { range: true, tokens: false, comment: false, + errorOnInvalidAST: true, errorOnUnknownASTType: true, /** * Babel will always throw on these types of issues, so we enable diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index d4abdb82801..e996df943f2 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -260,6 +260,12 @@ describe('convert', () => { }); } + generateTest( + 'a throw statement inside a block', + '{ throw }', + 'A throw statement must throw an expression.', + ); + generateTest( 'a decorator on an enum declaration', '@decl let value;', diff --git a/packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot index 71e4b3acbbb..968a9c94c49 100644 --- a/packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot @@ -1,10 +1,242 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`javascript classes invalid-class-two-super-classes.src 1`] = ` -TSError { - "column": 18, - "index": 18, - "lineNumber": 1, - "message": "Classes can only extend a single class.", +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "type": "ClassDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 15, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", } `; diff --git a/packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot index ac792b26e67..7d5c0914427 100644 --- a/packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot @@ -1,10 +1,243 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`javascript experimentalDynamicImport error-dynamic-import-params.src 1`] = ` -TSError { - "column": 7, - "index": 7, - "lineNumber": 1, - "message": "Dynamic import requires exactly one or two arguments.", +Object { + "body": Array [ + Object { + "expression": Object { + "attributes": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "''", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + "type": "ImportExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "ExpressionStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "'foo'", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "String", + "value": "''", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "String", + "value": "''", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + ], + "type": "Program", } `; diff --git a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot index 5467f678c18..444785b7141 100644 --- a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot @@ -1,10 +1,247 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`javascript modules invalid-export-module-specifier.src 1`] = ` -TSError { - "column": 19, - "index": 19, - "lineNumber": 1, - "message": "Module specifier must be a string literal.", +Object { + "body": Array [ + Object { + "assertions": Array [], + "declaration": null, + "exportKind": "value", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "specifiers": Array [ + Object { + "exportKind": "value", + "exported": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "range": Array [ + 9, + 12, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", } `; diff --git a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot index 0754b716ae5..222225d13dd 100644 --- a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot @@ -1,10 +1,191 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`javascript modules invalid-import-default-module-specifier.src 1`] = ` -TSError { - "column": 15, - "index": 15, - "lineNumber": 1, - "message": "Module specifier must be a string literal.", +Object { + "body": Array [ + Object { + "assertions": Array [], + "importKind": "value", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", } `; diff --git a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot index d456d2e4679..d0033e63039 100644 --- a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot @@ -1,10 +1,229 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`javascript modules invalid-import-module-specifier.src 1`] = ` -TSError { - "column": 17, - "index": 17, - "lineNumber": 1, - "message": "Module specifier must be a string literal.", +Object { + "body": Array [ + Object { + "assertions": Array [], + "declaration": null, + "exportKind": "value", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "specifiers": Array [ + Object { + "exportKind": "value", + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "bar", + }, + ], + "type": "Program", } `; From 789abc739bfbd1bf3f32af8dcc997443bdf1969f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 6 Feb 2023 11:17:47 -0500 Subject: [PATCH 06/15] Moved tests to fixtures --- docs/architecture/TypeScript-ESTree.mdx | 5 -- .../_error_/export-missing-name/config.ts | 3 + .../_error_/export-missing-name/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/decorator/config.ts | 3 + .../fixtures/_error_/decorator/fixture.ts | 1 + .../decorator/snapshots/1-TSESTree-Error.shot | 3 + .../decorator/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/decorator/config.ts | 3 + .../fixtures/_error_/decorator/fixture.ts | 1 + .../decorator/snapshots/1-TSESTree-Error.shot | 3 + .../decorator/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/decorator/config.ts | 3 + .../fixtures/_error_/decorator/fixture.ts | 1 + .../decorator/snapshots/1-TSESTree-Error.shot | 3 + .../decorator/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/decorator/config.ts | 3 + .../fixtures/_error_/decorator/fixture.ts | 1 + .../decorator/snapshots/1-TSESTree-Error.shot | 3 + .../decorator/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/no-variables/config.ts | 3 + .../fixtures/_error_/no-variables/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../no-variables/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/missing-argument/config.ts | 3 + .../_error_/missing-argument/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../tests/util/parsers/typescript-estree.ts | 1 + packages/ast-spec/typings/global.d.ts | 2 + packages/parser/tests/lib/parser.ts | 2 - .../tests/lib/convert.test.ts | 68 ++++--------------- 40 files changed, 110 insertions(+), 61 deletions(-) create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts create mode 100644 packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts create mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts create mode 100644 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts create mode 100644 packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts create mode 100644 packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot diff --git a/docs/architecture/TypeScript-ESTree.mdx b/docs/architecture/TypeScript-ESTree.mdx index e45abe0a5d2..2247825531f 100644 --- a/docs/architecture/TypeScript-ESTree.mdx +++ b/docs/architecture/TypeScript-ESTree.mdx @@ -51,10 +51,6 @@ interface ParseOptions { /** * Causes the parser to an error if it receives an invalid AST from TypeScript. * This case only usually occurs when attempting to lint invalid code. - * - * @remarks - * This is because TypeScript reports some syntax issues as semantic diagnostics. - * See https://github.com/typescript-eslint/typescript-eslint/issues/1852. */ errorOnInvalidAST?: boolean; @@ -109,7 +105,6 @@ interface ParseOptions { const PARSE_DEFAULT_OPTIONS: ParseOptions = { comment: false, - filePath: 'estree.ts', // or 'estree.tsx', if you pass jsx: true jsx: false, loc: false, diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts new file mode 100644 index 00000000000..0566b7ec569 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts @@ -0,0 +1,3 @@ +export default { + errorOnInvalidAST: true, +}; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts new file mode 100644 index 00000000000..1be56801515 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts @@ -0,0 +1 @@ +export class { } \ No newline at end of file diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..49ec0dafbdc --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `[TSError: A class declaration without the 'default' modifier must have a name.]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..f81327f8c1f --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Babel - Error 1`] = `[SyntaxError: A class name is required. (1:13)]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..09c3f103496 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts new file mode 100644 index 00000000000..0566b7ec569 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts @@ -0,0 +1,3 @@ +export default { + errorOnInvalidAST: true, +}; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts new file mode 100644 index 00000000000..b08d9da9640 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts @@ -0,0 +1 @@ +@decl enum Test {} \ No newline at end of file diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..ddc54896d0e --- /dev/null +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..fdb865b6c32 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..f0a67ebe105 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts new file mode 100644 index 00000000000..0566b7ec569 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts @@ -0,0 +1,3 @@ +export default { + errorOnInvalidAST: true, +}; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts new file mode 100644 index 00000000000..871f4361dc0 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts @@ -0,0 +1 @@ +@decl interface Test {}; \ No newline at end of file diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..571d3b80058 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..a9513b747ea --- /dev/null +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..6018ccd90e0 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts new file mode 100644 index 00000000000..0566b7ec569 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts @@ -0,0 +1,3 @@ +export default { + errorOnInvalidAST: true, +}; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts new file mode 100644 index 00000000000..94db52816b7 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts @@ -0,0 +1 @@ +@decl type Test = {}; \ No newline at end of file diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..1e27867db04 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..635e4f5a1cf --- /dev/null +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..f99acadf19a --- /dev/null +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts new file mode 100644 index 00000000000..0566b7ec569 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts @@ -0,0 +1,3 @@ +export default { + errorOnInvalidAST: true, +}; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts new file mode 100644 index 00000000000..94db52816b7 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts @@ -0,0 +1 @@ +@decl type Test = {}; \ No newline at end of file diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..3303119238c --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..6dbe967b047 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..2076158e5e7 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts new file mode 100644 index 00000000000..0566b7ec569 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts @@ -0,0 +1,3 @@ +export default { + errorOnInvalidAST: true, +}; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts new file mode 100644 index 00000000000..3b75833d490 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts @@ -0,0 +1 @@ +const; \ No newline at end of file diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..2537debfc2b --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..18d3755b6a4 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Babel - Error 1`] = `[SyntaxError: Unexpected token (1:5)]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..8ff6adabf68 --- /dev/null +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts new file mode 100644 index 00000000000..0566b7ec569 --- /dev/null +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts @@ -0,0 +1,3 @@ +export default { + errorOnInvalidAST: true, +}; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts new file mode 100644 index 00000000000..c4c933930d1 --- /dev/null +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts @@ -0,0 +1,3 @@ +{ + throw +} \ No newline at end of file diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..1a7f6913130 --- /dev/null +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `[TSError: A throw statement must throw an expression.]`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..f723750f0ee --- /dev/null +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Babel - Error 1`] = `[SyntaxError: Illegal newline after throw. (2:9)]`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..51974790455 --- /dev/null +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree.ts b/packages/ast-spec/tests/util/parsers/typescript-estree.ts index 6cfe656f4bf..034f4ac9384 100644 --- a/packages/ast-spec/tests/util/parsers/typescript-estree.ts +++ b/packages/ast-spec/tests/util/parsers/typescript-estree.ts @@ -13,6 +13,7 @@ export function parseTSESTree( loc: true, range: true, tokens: true, + errorOnInvalidAST: fixture.config.errorOnInvalidAST, }); const { tokens: _, comments: __, ...program } = result; diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts index 4464c06fbcf..67ae1aa22c4 100644 --- a/packages/ast-spec/typings/global.d.ts +++ b/packages/ast-spec/typings/global.d.ts @@ -11,4 +11,6 @@ interface ASTFixtureConfig { * The value should be a description of why there isn't support - for example a github issue URL. */ readonly expectBabelToNotSupport?: string; + + readonly errorOnInvalidAST?: boolean; } diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index c5526dda32d..9c18ff8c4e1 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -35,7 +35,6 @@ describe('parser', () => { // ts-estree specific filePath: 'isolated-file.src.ts', project: 'tsconfig.json', - errorOnTypeScriptSyntacticAndSemanticIssues: false, tsconfigRootDir: 'tests/fixtures/services', extraFileExtensions: ['.foo'], @@ -89,7 +88,6 @@ describe('parser', () => { // ts-estree specific filePath: 'isolated-file.src.ts', project: 'tsconfig.json', - errorOnTypeScriptSyntacticAndSemanticIssues: false, tsconfigRootDir: 'tests/fixtures/services', extraFileExtensions: ['.foo'], diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index e996df943f2..daa260ad319 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -240,66 +240,26 @@ describe('convert', () => { }); describe('errorOnInvalidAST', () => { - function generateTest(title: string, code: string, error: string): void { - it(`does not throw an error for ${title} when errorOnInvalidAST is false`, () => { - const ast = convertCode(code); + const code = 'const;'; + const error = + 'A variable declaration list must have at least one variable declarator.'; - const instance = new Converter(ast); + it(`does not throw an error for an invalid AST when errorOnInvalidAST is false`, () => { + const ast = convertCode(code); - expect(() => instance.convertProgram()).not.toThrow(); - }); + const instance = new Converter(ast); - it(`throws an error for ${title} when errorOnInvalidAST is true`, () => { - const ast = convertCode(code); + expect(() => instance.convertProgram()).not.toThrow(); + }); - const instance = new Converter(ast, { - errorOnInvalidAST: true, - }); + it(`throws an error for an invalid AST when errorOnInvalidAST is true`, () => { + const ast = convertCode(code); - expect(() => instance.convertProgram()).toThrow(error); + const instance = new Converter(ast, { + errorOnInvalidAST: true, }); - } - - generateTest( - 'a throw statement inside a block', - '{ throw }', - 'A throw statement must throw an expression.', - ); - - generateTest( - 'a decorator on an enum declaration', - '@decl let value;', - 'Decorators are not valid here.', - ); - generateTest( - 'a decorator on an interface declaration', - '@decl interface _ {};', - 'Decorators are not valid here.', - ); - - generateTest( - 'a decorator on a type alias declaration', - '@decl type _ = {};', - 'Decorators are not valid here.', - ); - - generateTest( - 'a decorator on a variable statement', - '@decl let value;', - 'Decorators are not valid here.', - ); - - generateTest( - 'an exported class declaration without a name', - 'export class { }', - "A class declaration without the 'default' modifier must have a name.", - ); - - generateTest( - 'a variable declaration with no variables', - 'const;', - 'A variable declaration list must have at least one variable declarator.', - ); + expect(() => instance.convertProgram()).toThrow(error); + }); }); }); From f1e39d20235ad66e3067e8607862396b51463a51 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 6 Feb 2023 11:28:08 -0500 Subject: [PATCH 07/15] Fix website build --- packages/website/src/components/linter/config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/website/src/components/linter/config.ts b/packages/website/src/components/linter/config.ts index 506f3952a2f..b0116e0b253 100644 --- a/packages/website/src/components/linter/config.ts +++ b/packages/website/src/components/linter/config.ts @@ -19,6 +19,8 @@ export const parseSettings: ParseSettings = { range: true, tokens: [], tsconfigRootDir: '/', + errorOnInvalidAST: false, + errorOnUnknownASTType: false, errorOnTypeScriptSyntacticAndSemanticIssues: false, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, singleRun: false, From baef9ebc72476f31da6355fe27263ff91025b572 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 16 Feb 2023 14:15:32 -0500 Subject: [PATCH 08/15] Sort the typescript-estree parser argument --- packages/ast-spec/tests/util/parsers/typescript-estree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree.ts b/packages/ast-spec/tests/util/parsers/typescript-estree.ts index 034f4ac9384..24dd62dd55a 100644 --- a/packages/ast-spec/tests/util/parsers/typescript-estree.ts +++ b/packages/ast-spec/tests/util/parsers/typescript-estree.ts @@ -9,11 +9,11 @@ export function parseTSESTree( try { const result = parse(contents, { comment: false, + errorOnInvalidAST: fixture.config.errorOnInvalidAST, jsx: fixture.ext.endsWith('x'), loc: true, range: true, tokens: true, - errorOnInvalidAST: fixture.config.errorOnInvalidAST, }); const { tokens: _, comments: __, ...program } = result; From bf34a86693d604504c424b9f30fd0fd0686027de Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 16 Feb 2023 14:32:34 -0500 Subject: [PATCH 09/15] Delete some files; rename the option --- docs/architecture/TypeScript-ESTree.mdx | 12 +- .../_error_/export-missing-name/config.ts | 2 +- .../_error_/export-missing-name/fixture.ts | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/decorator/config.ts | 2 +- .../fixtures/_error_/decorator/fixture.ts | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/decorator/config.ts | 2 +- .../fixtures/_error_/decorator/fixture.ts | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/decorator/config.ts | 2 +- .../fixtures/_error_/decorator/fixture.ts | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/decorator/config.ts | 2 +- .../fixtures/_error_/decorator/fixture.ts | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/no-variables/config.ts | 2 +- .../fixtures/_error_/no-variables/fixture.ts | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../_error_/missing-argument/config.ts | 2 +- .../_error_/missing-argument/fixture.ts | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures-with-differences-errors.shot | 15 +- .../tests/util/parsers/typescript-estree.ts | 2 +- packages/ast-spec/typings/global.d.ts | 8 +- .../typescript-estree/src/ast-converter.ts | 2 +- packages/typescript-estree/src/convert.ts | 24 +- .../src/parseSettings/createParseSettings.ts | 2 +- .../src/parseSettings/index.ts | 10 +- .../typescript-estree/src/parser-options.ts | 16 +- .../tests/ast-alignment/parse.ts | 142 -- .../semantic-diagnostics-enabled.test.ts.snap | 1165 ----------------- .../tests/lib/convert.test.ts | 8 +- .../lib/semantic-diagnostics-enabled.test.ts | 45 - ...nvalid-class-two-super-classes.src.js.shot | 242 ---- .../error-dynamic-import-params.src.js.shot | 243 ---- ...nvalid-export-module-specifier.src.js.shot | 247 ---- ...mport-default-module-specifier.src.js.shot | 191 --- ...nvalid-import-module-specifier.src.js.shot | 229 ---- .../website/src/components/linter/config.ts | 19 +- 63 files changed, 102 insertions(+), 2608 deletions(-) delete mode 100644 packages/typescript-estree/tests/ast-alignment/parse.ts delete mode 100644 packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap delete mode 100644 packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts delete mode 100644 packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot delete mode 100644 packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot delete mode 100644 packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot delete mode 100644 packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot delete mode 100644 packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot diff --git a/docs/architecture/TypeScript-ESTree.mdx b/docs/architecture/TypeScript-ESTree.mdx index 25ae7007081..8138f111ca0 100644 --- a/docs/architecture/TypeScript-ESTree.mdx +++ b/docs/architecture/TypeScript-ESTree.mdx @@ -31,6 +31,12 @@ Parses the given string of code with the options provided and returns an ESTree- ```ts interface ParseOptions { + /** + * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. + * This case only usually occurs when attempting to lint invalid code. + */ + allowInvalidAST?: boolean; + /** * create a top-level comments array containing all comments */ @@ -48,12 +54,6 @@ interface ParseOptions { */ debugLevel?: boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; - /** - * Causes the parser to an error if it receives an invalid AST from TypeScript. - * This case only usually occurs when attempting to lint invalid code. - */ - errorOnInvalidAST?: boolean; - /** * Cause the parser to error if it encounters an unknown AST node type (useful for testing). * This case only usually occurs when TypeScript releases new features. diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts index 0566b7ec569..44d06caf7f9 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts @@ -1,3 +1,3 @@ export default { - errorOnInvalidAST: true, + allowInvalidAST: true, }; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts index 1be56801515..d54b28def83 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts @@ -1 +1 @@ -export class { } \ No newline at end of file +export class { } diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot index 49ec0dafbdc..c39fb953513 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `[TSError: A class declaration without the 'default' modifier must have a name.]`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot index 09c3f103496..72c44523ffa 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot index c01d828d2c5..bcf5b40695c 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source TSESTree - Error 1`] = `[TSError: Module specifier must be a string literal.]`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot index 6917637d914..3a1a419a831 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot index 4bb37139b1b..c7816e168a0 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `[TSError: A class declaration without the 'default' modifier must have a name.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot index 82e5ade4750..1f517013974 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot index fb74333f793..4cfff84fd98 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source TSESTree - Error 1`] = `[TSError: Module specifier must be a string literal.]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot index 9c5c8d2bd78..0d5964ffc24 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts index 0566b7ec569..44d06caf7f9 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts @@ -1,3 +1,3 @@ export default { - errorOnInvalidAST: true, + allowInvalidAST: true, }; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts index b08d9da9640..7f23a59e1c5 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts @@ -1 +1 @@ -@decl enum Test {} \ No newline at end of file +@decl enum Test {} diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index ddc54896d0e..9eb1f7d1401 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index f0a67ebe105..4851229263b 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts index 0566b7ec569..44d06caf7f9 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts @@ -1,3 +1,3 @@ export default { - errorOnInvalidAST: true, + allowInvalidAST: true, }; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts index 871f4361dc0..c6b88c003fb 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts @@ -1 +1 @@ -@decl interface Test {}; \ No newline at end of file +@decl interface Test {} diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 571d3b80058..502dd8aee5c 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 6018ccd90e0..fb137780f45 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts index 0566b7ec569..44d06caf7f9 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts @@ -1,3 +1,3 @@ export default { - errorOnInvalidAST: true, + allowInvalidAST: true, }; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts index 94db52816b7..8c24b75c66c 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts @@ -1 +1 @@ -@decl type Test = {}; \ No newline at end of file +@decl type Test = {}; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 1e27867db04..7adabe715b7 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index f99acadf19a..43ad98f601b 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts index 0566b7ec569..44d06caf7f9 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts @@ -1,3 +1,3 @@ export default { - errorOnInvalidAST: true, + allowInvalidAST: true, }; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts index 94db52816b7..8c24b75c66c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts @@ -1 +1 @@ -@decl type Test = {}; \ No newline at end of file +@decl type Test = {}; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 3303119238c..cd619979c77 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 2076158e5e7..27f74be3902 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot index 6537d529262..b6143b26351 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot index cd2401b6862..89f5785e4c7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts index 0566b7ec569..44d06caf7f9 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts @@ -1,3 +1,3 @@ export default { - errorOnInvalidAST: true, + allowInvalidAST: true, }; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts index 3b75833d490..c53e6c27952 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts @@ -1 +1 @@ -const; \ No newline at end of file +const; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot index 2537debfc2b..7db91eb0bf7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot index 8ff6adabf68..5ce744c9338 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot index bcb52edf68d..742536148f8 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot index 17ba689c614..a6c9ea30e6f 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot index 3905750f9aa..8129621b578 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot index f7a4fa57521..c8b6e5b79da 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot index 184f3d96b4d..6a3e6dfc98d 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot index 1c90fdcf540..a48f982c9a8 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot index acfafbcff24..b98021ef688 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot index 5ba96a6641e..2afa3285def 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts index 0566b7ec569..44d06caf7f9 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts @@ -1,3 +1,3 @@ export default { - errorOnInvalidAST: true, + allowInvalidAST: true, }; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts index c4c933930d1..e1a5a7980c3 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts @@ -1,3 +1,3 @@ { throw -} \ No newline at end of file +} diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot index 1a7f6913130..4c9d87d4710 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `[TSError: A throw statement must throw an expression.]`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot index 51974790455..79c7461a897 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 43dd9a17eae..aa392ec0b3c 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -3,26 +3,28 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` Object { "Babel errored but TSESTree didn't": Set { + "declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/kind-type/fixture.ts", - "declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts", - "declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts", "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/ImportDeclaration/fixtures/_error_/non-string-source/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", + "declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", + "declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts", + "declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", - "declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture.ts", + "declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts", + "declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts", @@ -47,10 +49,7 @@ Object { "legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts", @@ -79,9 +78,9 @@ Object { "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", + "statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts", }, "TSESTree errored but Babel didn't": Set { "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree.ts b/packages/ast-spec/tests/util/parsers/typescript-estree.ts index 24dd62dd55a..3f26f539a7e 100644 --- a/packages/ast-spec/tests/util/parsers/typescript-estree.ts +++ b/packages/ast-spec/tests/util/parsers/typescript-estree.ts @@ -8,8 +8,8 @@ export function parseTSESTree( ): ParserResponse { try { const result = parse(contents, { + allowInvalidAST: fixture.config.allowInvalidAST, comment: false, - errorOnInvalidAST: fixture.config.errorOnInvalidAST, jsx: fixture.ext.endsWith('x'), loc: true, range: true, diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts index 67ae1aa22c4..7dd0713ea5d 100644 --- a/packages/ast-spec/typings/global.d.ts +++ b/packages/ast-spec/typings/global.d.ts @@ -4,6 +4,12 @@ * This is a convenient property because it saves us from a lot of `../`! */ interface ASTFixtureConfig { + /** + * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. + * This case only usually occurs when attempting to lint invalid code. + */ + readonly allowInvalidAST?: boolean; + /** * Specifies that we expect that babel doesn't yet support the code in this fixture, so we expect that it will error. * This should not be used if we expect babel to throw for this feature due to a valid parser error! @@ -11,6 +17,4 @@ interface ASTFixtureConfig { * The value should be a description of why there isn't support - for example a github issue URL. */ readonly expectBabelToNotSupport?: string; - - readonly errorOnInvalidAST?: boolean; } diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index fceaff03aef..c1bca84629d 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -26,7 +26,7 @@ export function astConverter( * Recursively convert the TypeScript AST into an ESTree-compatible AST */ const instance = new Converter(ast, { - errorOnInvalidAST: parseSettings.errorOnInvalidAST || false, + allowInvalidAST: parseSettings.allowInvalidAST || false, errorOnUnknownASTType: parseSettings.errorOnUnknownASTType || false, shouldPreserveNodeMaps, }); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 9359253a530..6083f31c2ae 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -38,7 +38,7 @@ import { AST_NODE_TYPES } from './ts-estree'; const SyntaxKind = ts.SyntaxKind; interface ConverterOptions { - errorOnInvalidAST?: boolean; + allowInvalidAST?: boolean; errorOnUnknownASTType?: boolean; shouldPreserveNodeMaps?: boolean; } @@ -710,7 +710,7 @@ export class Converter { allowNull: boolean, ): void { if (!allowNull && node.moduleSpecifier == null) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.pos, 'Module specifier must be a string literal.', ); @@ -720,7 +720,7 @@ export class Converter { node.moduleSpecifier && node.moduleSpecifier?.kind !== SyntaxKind.StringLiteral ) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.moduleSpecifier.pos, 'Module specifier must be a string literal.', ); @@ -842,7 +842,7 @@ export class Converter { case SyntaxKind.ThrowStatement: if (node.expression.end === node.expression.pos) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.pos, 'A throw statement must throw an expression.', ); @@ -993,7 +993,7 @@ export class Converter { }); if (!result.declarations.length) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.pos, 'A variable declaration list must have at least one variable declarator.', ); @@ -1276,7 +1276,7 @@ export class Converter { !hasModifier(ts.SyntaxKind.AbstractKeyword, node) && !hasModifier(ts.SyntaxKind.AbstractKeyword, node.parent) ) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.name.pos, 'Function implementation is missing or not immediately following the declaration.', ); @@ -1706,7 +1706,7 @@ export class Converter { (!hasModifier(ts.SyntaxKind.ExportKeyword, node) || !hasModifier(ts.SyntaxKind.DefaultKeyword, node)) ) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.pos, "A class declaration without the 'default' modifier must have a name.", ); @@ -1744,7 +1744,7 @@ export class Converter { if (superClass) { if (superClass.types.length > 1) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( superClass.types[1].pos, 'Classes can only extend a single class.', ); @@ -2071,7 +2071,7 @@ export class Converter { case SyntaxKind.CallExpression: { if (node.expression.kind === SyntaxKind.ImportKeyword) { if (node.arguments.length !== 1 && node.arguments.length !== 2) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.arguments.pos, 'Dynamic import requires exactly one or two arguments.', ); @@ -3071,15 +3071,15 @@ export class Converter { #checkIllegalDecorators(node: ts.Node): void { if (nodeHasIllegalDecorators(node)) { - this.#throwIfErrorOnInvalidAST( + this.#throwUnlessAllowInvalidAST( node.pos, 'Decorators are not valid here.', ); } } - #throwIfErrorOnInvalidAST(pos: number, message: string): void { - if (this.options.errorOnInvalidAST) { + #throwUnlessAllowInvalidAST(pos: number, message: string): void { + if (!this.options.allowInvalidAST) { throw createError(this.ast, pos, message); } } diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 9afc81ba231..9e4d8acb943 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -31,6 +31,7 @@ export function createParseSettings( ? options.tsconfigRootDir : process.cwd(); const parseSettings: MutableParseSettings = { + allowInvalidAST: options.allowInvalidAST === true, code, codeFullText, comment: options.comment === true, @@ -44,7 +45,6 @@ export function createParseSettings( : Array.isArray(options.debugLevel) ? new Set(options.debugLevel) : new Set(), - errorOnInvalidAST: options.errorOnInvalidAST === true, errorOnTypeScriptSyntacticAndSemanticIssues: false, errorOnUnknownASTType: options.errorOnUnknownASTType === true, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: diff --git a/packages/typescript-estree/src/parseSettings/index.ts b/packages/typescript-estree/src/parseSettings/index.ts index 8b9d30a8a1d..b97050b5fdf 100644 --- a/packages/typescript-estree/src/parseSettings/index.ts +++ b/packages/typescript-estree/src/parseSettings/index.ts @@ -10,6 +10,11 @@ type DebugModule = 'typescript-eslint' | 'eslint' | 'typescript'; * Internal settings used by the parser to run on a file. */ export interface MutableParseSettings { + /** + * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. + */ + allowInvalidAST: boolean; + /** * Code of the file being parsed, or raw source file containing it. */ @@ -42,11 +47,6 @@ export interface MutableParseSettings { */ debugLevel: Set; - /** - * Whether to throw an error when a required node child does not exist. - */ - errorOnInvalidAST: boolean; - /** * Whether to error if TypeScript reports a semantic or syntactic error diagnostic. */ diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index e8c22d81e0c..53a49eaafd1 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -11,6 +11,12 @@ import type { TSESTree, TSESTreeToTSNode, TSNode, TSToken } from './ts-estree'; ////////////////////////////////////////////////////////// interface ParseOptions { + /** + * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. + * This case only usually occurs when attempting to lint invalid code. + */ + allowInvalidAST?: boolean; + /** * create a top-level comments array containing all comments */ @@ -28,16 +34,6 @@ interface ParseOptions { */ debugLevel?: DebugLevel; - /** - * Causes the parser to an error if it sees that a required node child does not exist. - * This case only usually occurs when attempting to lint invalid code. - * - * @remarks - * This is because TypeScript reports some syntax issues as semantic diagnostics. - * See https://github.com/typescript-eslint/typescript-eslint/issues/1852. - */ - errorOnInvalidAST?: boolean; - /** * Cause the parser to error if it encounters an unknown AST node type (useful for testing). * This case only usually occurs when TypeScript releases new features. diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts deleted file mode 100644 index f8020060352..00000000000 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */ -import { codeFrameColumns } from '@babel/code-frame'; -import type babelParser from '@babel/parser'; -import type { ParserPlugin } from '@babel/parser'; -import type { File } from '@babel/types'; -import type { TSESTree } from '@typescript-eslint/types'; -import * as path from 'path'; - -import type { TSError } from '../../src/node-utils'; -import type { AST } from '../../src/parser'; -import { parseAndGenerateServices } from '../../src/parser'; - -function createError( - message: string, - line: number, - column: number, -): SyntaxError { - // Construct an error similar to the ones thrown by Babylon. - const error = new SyntaxError(`${message} (${line}:${column})`); - (error as any).loc = { - line, - column, - }; - return error; -} - -function parseWithBabelParser(text: string, jsx = true): File { - const babel = require('@babel/parser') as typeof babelParser; - const plugins: ParserPlugin[] = [ - [ - 'estree', - { - classFeatures: true, - }, - ], - 'decorators-legacy', - 'classStaticBlock', - 'importAssertions', - 'typescript', - ]; - if (jsx) { - plugins.push('jsx'); - } - - return babel.parse(text, { - sourceType: 'unambiguous', - allowImportExportEverywhere: true, - allowReturnOutsideFunction: true, - ranges: true, - plugins, - }); -} - -const emptyProjectPath = path.resolve( - __dirname, - '..', - 'fixtures', - 'simpleProject', -); -function parseWithTypeScriptESTree(text: string, jsx = true): AST { - try { - const result = parseAndGenerateServices(text, { - loc: true, - range: true, - tokens: false, - comment: false, - errorOnInvalidAST: true, - errorOnUnknownASTType: true, - /** - * Babel will always throw on these types of issues, so we enable - * them in typescript-estree when comparing behavior between the - * two parsers. By default, the TypeScript compiler is much more - * forgiving. - */ - errorOnTypeScriptSyntacticAndSemanticIssues: true, - project: [path.join(emptyProjectPath, 'tsconfig.json')], - tsconfigRootDir: emptyProjectPath, - filePath: path.join(emptyProjectPath, jsx ? 'file-jsx.tsx' : 'file.ts'), - jsx, - }); - return result.ast; - } catch (e: unknown) { - const error = e as TSError; - - throw createError(error.message, error.lineNumber, error.column); - } -} - -interface ASTComparisonParseOptions { - parser: string; - jsx?: boolean; -} - -export function parse( - text: string, - opts: ASTComparisonParseOptions, -): { parseError: any | null; ast: any | null } { - /** - * Always return a consistent interface, there will be times when we expect both - * parsers to fail to parse the invalid source. - */ - const result: { parseError: any | null; ast: any | null } = { - parseError: null, - ast: null, - }; - - try { - switch (opts.parser) { - case '@typescript-eslint/typescript-estree': - result.ast = parseWithTypeScriptESTree(text, opts.jsx); - break; - case '@babel/parser': - result.ast = parseWithBabelParser(text, opts.jsx); - break; - default: - throw new Error( - 'Please provide a valid parser: either "typescript-estree" or "@babel/parser"', - ); - } - } catch (error: any) { - const loc = error.loc as TSESTree.Position | undefined; - if (loc) { - error.codeFrame = codeFrameColumns( - text, - { - start: { - line: loc.line, - column: loc.column + 1, - }, - }, - { - highlightCode: true, - }, - ); - error.message += `\n${error.codeFrame}`; - } - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - result.parseError = error; - } - - return result; -} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap deleted file mode 100644 index 070c63ca845..00000000000 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ /dev/null @@ -1,1165 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/missing-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/abstract/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/decorator-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/decorator-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/extends-literal/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/extends-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/implements-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/implements-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/with-member-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/kind-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/assertion/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/named/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/unnamed/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/class/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/literal/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/aliased/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/class/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/declare-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/enum/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/function-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/type-alias/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/variable-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/async/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/generator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/param-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/param-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/returnType/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/type-param-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/type-param-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/non-string-source/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/assertion/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-named-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-named-none/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-named-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/named-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/named-none/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/named-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/side-effect/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/async/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/generator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/param-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/param-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/returnType/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/type-param-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/type-param-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/without-declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/const/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/with-member-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/extends-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/extends-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/type-param-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/with-member-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/global/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-id-identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-id-literal/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/namespace-declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSNamespaceExportDeclaration/fixtures/valid/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/valid/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/const-with-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/const-without-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/let-with-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/let-without-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/multiple-declarations/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/var-with-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/var-without-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-computed-complex/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-computed-number/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-computed-string/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-number/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-private/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-string/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-abstract/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-override/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-private/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-protected/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-public/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-readonly/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-static/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/no-annotation-no-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/no-annotation-with-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/with-annotation-no-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/with-annotation-with-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/array-array/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/async-function-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/call-signatures/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-multi/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-multi-assign/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-operator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-simple/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-static-blocks/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-definite-assignment/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-extends-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-generic-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-generic-method-default/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-implements/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-mixin/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-mixin-reference/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-override-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-override-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-property-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-property-values/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/const-enum/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/declare-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment-object/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/directive-in-module/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/directive-in-namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-as-namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-assignment/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-default-class-with-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-default-interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-named-enum/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-star-as-ns-from/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type-as/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type-from/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type-from-as/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-overloads/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-await/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-types/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-types-assignation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/global-this/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-equal-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-default/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-named/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-named-as/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-with-import-assertions/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/keyof-operator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/keyword-variables/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/nested-type-arguments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/never-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/nullish-coalescing/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-call/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-element-access/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-with-parens/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/parenthesized-use-strict/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/private-fields-in-in/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/readonly-arrays/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/readonly-tuples/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/symbol-type-param/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-import-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-parameters-comments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-reference-comments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-bigint/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-boolean/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-false/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-never/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-null/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-number/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-object/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-string/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-symbol/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-true/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-undefined/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-unknown/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-void/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-method-signature/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-this/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/union-intersection/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/unique-symbol/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/var-with-dotted-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/var-with-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/class-decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/comments/fixtures/type-assertion-regression-test/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/abstract-class/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/class/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/enum/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/interface/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/module/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/namespace/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/type-alias/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/variable/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/array-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer-nested/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer-simple/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-with-null/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-abstract/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-in-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-with-rest/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-in-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-array-destruction/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-object-destruction/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-rest/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-this/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/index-signature/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/index-signature-readonly/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/index-signature-without-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/indexed/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/interface-with-accessors/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/intersection-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/literal-number/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/literal-number-negative/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/literal-string/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-named-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-readonly/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-untypped/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/nested-types/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-in/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-in-and-out/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-in-out/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-out/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/parenthesized-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/reference/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/reference-generic/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/reference-generic-nested/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-1/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-2/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-3/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-4/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/this-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/this-type-expanded/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-empty/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named-optional/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named-rest/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-optional/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-rest/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/type-literal/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/type-operator/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/typeof/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/typeof-this/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/union-intersection/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/union-type/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture 1`] = `[Error: Cannot calculate TypeScript semantic issues without a valid project.]`; diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index daa260ad319..05eb6cea107 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -239,12 +239,12 @@ describe('convert', () => { } }); - describe('errorOnInvalidAST', () => { + describe('allowInvalidAST', () => { const code = 'const;'; const error = 'A variable declaration list must have at least one variable declarator.'; - it(`does not throw an error for an invalid AST when errorOnInvalidAST is false`, () => { + it(`does not throw an error for an invalid AST when allowInvalidAST is false`, () => { const ast = convertCode(code); const instance = new Converter(ast); @@ -252,11 +252,11 @@ describe('convert', () => { expect(() => instance.convertProgram()).not.toThrow(); }); - it(`throws an error for an invalid AST when errorOnInvalidAST is true`, () => { + it(`throws an error for an invalid AST when allowInvalidAST is true`, () => { const ast = convertCode(code); const instance = new Converter(ast, { - errorOnInvalidAST: true, + allowInvalidAST: true, }); expect(() => instance.convertProgram()).toThrow(error); diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts deleted file mode 100644 index b87abc896cb..00000000000 --- a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { readFileSync } from 'fs'; -import glob from 'glob'; -import path from 'path'; - -import * as parser from '../../src'; -import { formatSnapshotName, isJSXFileType } from '../../tools/test-utils'; -import { serializer } from '../../tools/tserror-serializer'; - -/** - * Process all fixtures, we will only snapshot the ones that have semantic errors - * which are ignored by default parsing logic. - */ -const FIXTURES_DIR = path.join(__dirname, '../../../ast-spec/src'); - -const testFiles = glob.sync('**/fixture.ts', { - cwd: FIXTURES_DIR, -}); - -expect.addSnapshotSerializer(serializer); - -describe('Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled', () => { - testFiles.forEach(filename => { - const code = readFileSync(path.join(FIXTURES_DIR, filename), 'utf8'); - const fileExtension = path.extname(filename); - const config: parser.TSESTreeOptions = { - loc: true, - range: true, - tokens: true, - errorOnUnknownASTType: true, - errorOnTypeScriptSyntacticAndSemanticIssues: true, - jsx: isJSXFileType(fileExtension), - }; - it(formatSnapshotName(filename, FIXTURES_DIR, fileExtension), () => { - expect.assertions(1); - try { - parser.parseAndGenerateServices(code, config); - expect( - 'TEST OUTPUT: No semantic or syntactic issues found', - ).toMatchSnapshot(); - } catch (err) { - expect(err).toMatchSnapshot(); - } - }); - }); -}); diff --git a/packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot deleted file mode 100644 index 968a9c94c49..00000000000 --- a/packages/typescript-estree/tests/snapshots/javascript/classes/invalid-class-two-super-classes.src.js.shot +++ /dev/null @@ -1,242 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`javascript classes invalid-class-two-super-classes.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 23, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 23, - ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "B", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "type": "ClassDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 23, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "A", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 15, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - "value": "B", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - "value": "C", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; diff --git a/packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot deleted file mode 100644 index 7d5c0914427..00000000000 --- a/packages/typescript-estree/tests/snapshots/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js.shot +++ /dev/null @@ -1,243 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`javascript experimentalDynamicImport error-dynamic-import-params.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "attributes": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "raw": "''", - "type": "Literal", - "value": "", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 21, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 12, - ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", - }, - "type": "ImportExpression", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 21, - ], - "type": "ExpressionStatement", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "import", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 12, - ], - "type": "String", - "value": "'foo'", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "String", - "value": "''", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "String", - "value": "''", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ")", - }, - ], - "type": "Program", -} -`; diff --git a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot deleted file mode 100644 index 444785b7141..00000000000 --- a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot +++ /dev/null @@ -1,247 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`javascript modules invalid-export-module-specifier.src 1`] = ` -Object { - "body": Array [ - Object { - "assertions": Array [], - "declaration": null, - "exportKind": "value", - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 24, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "specifiers": Array [ - Object { - "exportKind": "value", - "exported": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "range": Array [ - 9, - 12, - ], - "type": "ExportSpecifier", - }, - ], - "type": "ExportNamedDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 25, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; diff --git a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot deleted file mode 100644 index 222225d13dd..00000000000 --- a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot +++ /dev/null @@ -1,191 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`javascript modules invalid-import-default-module-specifier.src 1`] = ` -Object { - "body": Array [ - Object { - "assertions": Array [], - "importKind": "value", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 20, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "specifiers": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "range": Array [ - 7, - 10, - ], - "type": "ImportDefaultSpecifier", - }, - ], - "type": "ImportDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "import", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 15, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; diff --git a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot b/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot deleted file mode 100644 index d0033e63039..00000000000 --- a/packages/typescript-estree/tests/snapshots/javascript/modules/invalid-import-module-specifier.src.js.shot +++ /dev/null @@ -1,229 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`javascript modules invalid-import-module-specifier.src 1`] = ` -Object { - "body": Array [ - Object { - "assertions": Array [], - "declaration": null, - "exportKind": "value", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 21, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "specifiers": Array [ - Object { - "exportKind": "value", - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 11, - ], - "type": "ExportSpecifier", - }, - ], - "type": "ExportNamedDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - "value": "bar", - }, - ], - "type": "Program", -} -`; diff --git a/packages/website/src/components/linter/config.ts b/packages/website/src/components/linter/config.ts index 9355824b067..7745a80a36d 100644 --- a/packages/website/src/components/linter/config.ts +++ b/packages/website/src/components/linter/config.ts @@ -1,30 +1,29 @@ import type { ParseSettings } from '@typescript-eslint/typescript-estree/dist/parseSettings'; export const parseSettings: ParseSettings = { + allowInvalidAST: false, code: '', codeFullText: '', comment: true, comments: [], - DEPRECATED__createDefaultProgram: false, debugLevel: new Set(), - + DEPRECATED__createDefaultProgram: false, + errorOnTypeScriptSyntacticAndSemanticIssues: false, + errorOnUnknownASTType: false, + EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, extraFileExtensions: [], filePath: '', jsx: false, loc: true, // eslint-disable-next-line no-console log: console.log, + moduleResolver: '', preserveNodeMaps: true, + programs: null, projects: [], range: true, + singleRun: false, tokens: [], - tsconfigRootDir: '/', - errorOnInvalidAST: false, - errorOnUnknownASTType: false, tsconfigMatchCache: new Map(), - errorOnTypeScriptSyntacticAndSemanticIssues: false, - EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, - singleRun: false, - programs: null, - moduleResolver: '', + tsconfigRootDir: '/', }; From d0d282541027cb7759a3af527f47cfe2ac043ec3 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 16 Feb 2023 14:51:32 -0500 Subject: [PATCH 10/15] Fixed unit test --- packages/typescript-estree/tests/lib/convert.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 05eb6cea107..1785c24b0e1 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -241,25 +241,25 @@ describe('convert', () => { describe('allowInvalidAST', () => { const code = 'const;'; - const error = - 'A variable declaration list must have at least one variable declarator.'; - it(`does not throw an error for an invalid AST when allowInvalidAST is false`, () => { + it(`throws an error for an invalid AST when allowInvalidAST is false`, () => { const ast = convertCode(code); const instance = new Converter(ast); - expect(() => instance.convertProgram()).not.toThrow(); + expect(() => instance.convertProgram()).toThrow( + 'A variable declaration list must have at least one variable declarator.', + ); }); - it(`throws an error for an invalid AST when allowInvalidAST is true`, () => { + it(`does not throw an error for an invalid AST when allowInvalidAST is true`, () => { const ast = convertCode(code); const instance = new Converter(ast, { allowInvalidAST: true, }); - expect(() => instance.convertProgram()).toThrow(error); + expect(() => instance.convertProgram()).not.toThrow(); }); }); }); From b947e889ab939bc1961865c6d565ccc4e1898823 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 17 Feb 2023 10:35:43 -0500 Subject: [PATCH 11/15] Allowed eror fixtures to error --- .../fixtures/_error_/export-missing-name/config.ts | 3 --- .../export-missing-name/snapshots/1-TSESTree-Error.shot | 2 +- .../export-missing-name/snapshots/3-Alignment-Error.shot | 2 +- .../TSEnumDeclaration/fixtures/_error_/decorator/config.ts | 3 --- .../_error_/decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../_error_/decorator/snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/decorator/config.ts | 3 --- .../_error_/decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../_error_/decorator/snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/decorator/config.ts | 3 --- .../_error_/decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../_error_/decorator/snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/decorator/config.ts | 3 --- .../_error_/decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../_error_/decorator/snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/no-variables/config.ts | 3 --- .../_error_/no-variables/snapshots/1-TSESTree-Error.shot | 2 +- .../_error_/no-variables/snapshots/3-Alignment-Error.shot | 2 +- .../fixtures/_error_/missing-argument/config.ts | 3 --- .../missing-argument/snapshots/1-TSESTree-Error.shot | 2 +- .../missing-argument/snapshots/3-Alignment-Error.shot | 2 +- .../ast-spec/tests/fixtures-with-differences-errors.shot | 7 ------- 22 files changed, 14 insertions(+), 42 deletions(-) delete mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts delete mode 100644 packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts delete mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts delete mode 100644 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts delete mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts delete mode 100644 packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts delete mode 100644 packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts deleted file mode 100644 index 44d06caf7f9..00000000000 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - allowInvalidAST: true, -}; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot index c39fb953513..49ec0dafbdc 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `[TSError: A class declaration without the 'default' modifier must have a name.]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot index 72c44523ffa..09c3f103496 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts deleted file mode 100644 index 44d06caf7f9..00000000000 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - allowInvalidAST: true, -}; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 9eb1f7d1401..ddc54896d0e 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 4851229263b..f0a67ebe105 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts deleted file mode 100644 index 44d06caf7f9..00000000000 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - allowInvalidAST: true, -}; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 502dd8aee5c..571d3b80058 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index fb137780f45..6018ccd90e0 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts deleted file mode 100644 index 44d06caf7f9..00000000000 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - allowInvalidAST: true, -}; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 7adabe715b7..1e27867db04 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 43ad98f601b..f99acadf19a 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts deleted file mode 100644 index 44d06caf7f9..00000000000 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - allowInvalidAST: true, -}; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index cd619979c77..3303119238c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 27f74be3902..2076158e5e7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts deleted file mode 100644 index 44d06caf7f9..00000000000 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - allowInvalidAST: true, -}; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot index 7db91eb0bf7..2537debfc2b 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot index 5ce744c9338..8ff6adabf68 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts deleted file mode 100644 index 44d06caf7f9..00000000000 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - allowInvalidAST: true, -}; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot index 4c9d87d4710..1a7f6913130 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `[TSError: A throw statement must throw an expression.]`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot index 79c7461a897..51974790455 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index aa392ec0b3c..ed482bcd2f9 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -3,7 +3,6 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` Object { "Babel errored but TSESTree didn't": Set { - "declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts", @@ -14,17 +13,12 @@ Object { "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", - "declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts", - "declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", - "declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts", - "declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts", @@ -80,7 +74,6 @@ Object { "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", - "statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts", }, "TSESTree errored but Babel didn't": Set { "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", From bfd2fd863f62699b2167de03ecfe66523836ee36 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 23 Feb 2023 00:57:17 -0500 Subject: [PATCH 12/15] Post-merge: standardized convert.ts throwing --- packages/typescript-estree/src/convert.ts | 30 ++++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 1c89799ea39..a605b8a7510 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -660,8 +660,7 @@ export class Converter { } if (hasModifier(SyntaxKind.ExportKeyword, node)) { - throw createError( - this.ast, + this.#throwUnlessAllowInvalidAST( node.pos, 'A method signature cannot have an export modifier.', ); @@ -1673,8 +1672,7 @@ export class Converter { const modifiers = getModifiers(node); if (modifiers) { if (hasModifier(SyntaxKind.ExportKeyword, node)) { - throw createError( - this.ast, + this.#throwUnlessAllowInvalidAST( node.pos, 'A parameter cannot have an export modifier.', ); @@ -2547,8 +2545,7 @@ export class Converter { ); if (hasModifier(SyntaxKind.ExportKeyword, node)) { - throw createError( - this.ast, + this.#throwUnlessAllowInvalidAST( node.pos, 'A property signature cannot have an export modifier.', ); @@ -2594,8 +2591,7 @@ export class Converter { } if (hasModifier(SyntaxKind.ExportKeyword, node)) { - throw createError( - this.ast, + this.#throwUnlessAllowInvalidAST( node.pos, 'An index signature cannot have an export modifier.', ); @@ -2835,10 +2831,14 @@ export class Converter { body == null || body.type === AST_NODE_TYPES.TSModuleDeclaration ) { - throw new Error('Expected a valid module body'); + this.#throwUnlessAllowInvalidAST( + body?.pos ?? node.pos, + 'Expected a valid module body', + ); } if (id.type !== AST_NODE_TYPES.Identifier) { - throw new Error( + this.#throwUnlessAllowInvalidAST( + id.pos, 'global module augmentation must have an Identifier id', ); } @@ -2865,10 +2865,16 @@ export class Converter { // with the innermost node's body as the actual node body. if (node.body == null) { - throw new Error('Expected a module body'); + this.#throwUnlessAllowInvalidAST( + node.pos, + 'Expected a module body', + ); } if (node.name.kind !== ts.SyntaxKind.Identifier) { - throw new Error('`namespace`s must have an Identifier id'); + this.#throwUnlessAllowInvalidAST( + node.name.pos, + '`namespace`s must have an Identifier id', + ); } let name: TSESTree.Identifier | TSESTree.TSQualifiedName = From 8121b2e2cc5ff0dee43465d8322b9bcff868290f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 23 Feb 2023 01:04:43 -0500 Subject: [PATCH 13/15] Removed erroneous function case, and now-invalid indent test case --- .../tests/rules/indent/indent.test.ts | 2 -- packages/typescript-estree/src/convert.ts | 20 ++++--------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/indent/indent.test.ts b/packages/eslint-plugin/tests/rules/indent/indent.test.ts index f9191d3ef10..951ffb59ea7 100644 --- a/packages/eslint-plugin/tests/rules/indent/indent.test.ts +++ b/packages/eslint-plugin/tests/rules/indent/indent.test.ts @@ -758,8 +758,6 @@ const div: JQuery = $('
') `, options: [2, { VariableDeclarator: { const: 3 } }], }, - // https://github.com/typescript-eslint/typescript-eslint/issues/441 - 'const;', // https://github.com/typescript-eslint/typescript-eslint/issues/1115 { diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index a605b8a7510..5b92621789d 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1265,18 +1265,6 @@ export class Converter { } else { // class - if ( - !node.body && - !node.questionToken && - !hasModifier(ts.SyntaxKind.AbstractKeyword, node) && - !hasModifier(ts.SyntaxKind.AbstractKeyword, node.parent) - ) { - this.#throwUnlessAllowInvalidAST( - node.name.pos, - 'Function implementation is missing or not immediately following the declaration.', - ); - } - /** * Unlike in object literal methods, class method params can have decorators */ @@ -2832,19 +2820,19 @@ export class Converter { body.type === AST_NODE_TYPES.TSModuleDeclaration ) { this.#throwUnlessAllowInvalidAST( - body?.pos ?? node.pos, + (node.body ?? node).pos, 'Expected a valid module body', ); } if (id.type !== AST_NODE_TYPES.Identifier) { this.#throwUnlessAllowInvalidAST( - id.pos, + node.name.pos, 'global module augmentation must have an Identifier id', ); } return { kind: 'global', - body, + body: body as TSESTree.TSModuleBlock, id, }; } @@ -2878,7 +2866,7 @@ export class Converter { } let name: TSESTree.Identifier | TSESTree.TSQualifiedName = - this.createNode(node.name, { + this.createNode(node.name as ts.Identifier, { name: node.name.text, range: [node.name.getStart(this.ast), node.name.getEnd()], type: AST_NODE_TYPES.Identifier, From 13e01441f81cea76db7967ab91b5b1eb65427aa8 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 4 Mar 2023 22:55:49 +1030 Subject: [PATCH 14/15] regen snapshots for latest v6 --- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../anonymous-class/snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 2 +- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../no-variables/snapshots/1-TSESTree-Error.shot | 2 +- .../no-variables/snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../solo-const/snapshots/1-TSESTree-Error.shot | 2 +- .../solo-const/snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../tests/fixtures-with-differences-errors.shot | 13 +++++++++++++ 27 files changed, 39 insertions(+), 26 deletions(-) diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot index 49ec0dafbdc..c39fb953513 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `[TSError: A class declaration without the 'default' modifier must have a name.]`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot index 09c3f103496..72c44523ffa 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot index c7816e168a0..4bb37139b1b 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `[TSError: A class declaration without the 'default' modifier must have a name.]`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot index 1f517013974..82e5ade4750 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index ddc54896d0e..9eb1f7d1401 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index f0a67ebe105..4851229263b 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 571d3b80058..502dd8aee5c 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 6018ccd90e0..fb137780f45 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 1e27867db04..7adabe715b7 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index f99acadf19a..43ad98f601b 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 3303119238c..cd619979c77 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 2076158e5e7..27f74be3902 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot index b6143b26351..6537d529262 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot index 89f5785e4c7..cd2401b6862 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot index 2537debfc2b..7db91eb0bf7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot index 8ff6adabf68..5ce744c9338 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot index 742536148f8..bcb52edf68d 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot index a6c9ea30e6f..17ba689c614 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot index 8129621b578..3905750f9aa 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot index c8b6e5b79da..f7a4fa57521 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot index 6a3e6dfc98d..184f3d96b4d 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `[TSError: Decorators are not valid here.]`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot index a48f982c9a8..1c90fdcf540 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot index b98021ef688..acfafbcff24 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `[TSError: A variable declaration list must have at least one variable declarator.]`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot index 2afa3285def..5ba96a6641e 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot index 1a7f6913130..4c9d87d4710 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `[TSError: A throw statement must throw an expression.]`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot index 51974790455..79c7461a897 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index ed482bcd2f9..8315b564721 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -3,22 +3,30 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` Object { "Babel errored but TSESTree didn't": Set { + "declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/kind-type/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts", "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", + "declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", + "declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts", + "declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", + "declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts", + "declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture.ts", + "declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts", @@ -43,7 +51,10 @@ Object { "legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts", @@ -72,8 +83,10 @@ Object { "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", + "statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts", }, "TSESTree errored but Babel didn't": Set { "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", From 7144e90713b1eb20d66854dd07c3a20ffc9630b1 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 5 Mar 2023 19:50:16 +1030 Subject: [PATCH 15/15] snaps --- .../snapshots/1-TSESTree-Error.shot | 7 ++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../anonymous-class/snapshots/1-TSESTree-Error.shot | 7 ++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 7 ++++++- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 7 ++++++- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 7 ++++++- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../decorator/snapshots/1-TSESTree-Error.shot | 7 ++++++- .../decorator/snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 7 ++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../no-variables/snapshots/1-TSESTree-Error.shot | 7 ++++++- .../no-variables/snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 +++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 9 ++++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 9 ++++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../solo-const/snapshots/1-TSESTree-Error.shot | 8 +++++++- .../solo-const/snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 9 ++++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../tests/fixtures-with-differences-errors.shot | 13 ------------- 27 files changed, 99 insertions(+), 39 deletions(-) diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot index c39fb953513..871a8fa73bd 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = ` +"TSError +> 1 | export class { } + | ^ A class declaration without the 'default' modifier must have a name. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot index 72c44523ffa..09c3f103496 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot index 4bb37139b1b..56c490f6432 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = ` +"TSError +> 1 | export class {} + | ^ A class declaration without the 'default' modifier must have a name. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot index 82e5ade4750..1f517013974 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 9eb1f7d1401..63b726390f8 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = ` +"TSError +> 1 | @decl enum Test {} + | ^ Decorators are not valid here. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 4851229263b..f0a67ebe105 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 502dd8aee5c..b97c19c1658 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = ` +"TSError +> 1 | @decl interface Test {} + | ^ Decorators are not valid here. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index fb137780f45..6018ccd90e0 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index 7adabe715b7..a9881c8490e 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = ` +"TSError +> 1 | @decl type Test = {}; + | ^ Decorators are not valid here. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 43ad98f601b..f99acadf19a 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot index cd619979c77..7f4b1ed5013 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = ` +"TSError +> 1 | @decl type Test = {}; + | ^ Decorators are not valid here. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot index 27f74be3902..2076158e5e7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot index 6537d529262..d3d985a8aac 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = ` +"TSError +> 1 | const; + | ^ A variable declaration list must have at least one variable declarator. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot index cd2401b6862..89f5785e4c7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot index 7db91eb0bf7..7f955d4645e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = ` +"TSError +> 1 | const; + | ^ A variable declaration list must have at least one variable declarator. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot index 5ce744c9338..8ff6adabf68 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot index bcb52edf68d..83e4badaaad 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = ` +"TSError +> 1 | // TODO: This fixture might be too large, and if so should be split up. + | ^ Decorators are not valid here. + 2 | + 3 | @dec enum E {}" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot index 17ba689c614..a6c9ea30e6f 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot index 3905750f9aa..edd55201765 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = ` +"TSError +> 1 | // TODO: This fixture might be too large, and if so should be split up. + | ^ Decorators are not valid here. + 2 | + 3 | @deco() + 4 | interface M {}" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot index f7a4fa57521..c8b6e5b79da 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot index 184f3d96b4d..1ec303a3706 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = ` +"TSError +> 1 | // TODO: This fixture might be too large, and if so should be split up. + | ^ Decorators are not valid here. + 2 | + 3 | @deco() + 4 | const a = 1" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot index 1c90fdcf540..a48f982c9a8 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot index acfafbcff24..6eeef3970c5 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = ` +"TSError +> 1 | // TODO: This fixture might be too large, and if so should be split up. + | ^ A variable declaration list must have at least one variable declarator. + 2 | + 3 | const" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot index 5ba96a6641e..2afa3285def 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot index 4c9d87d4710..4f6e41ca602 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = ` +"TSError +> 1 | { + | ^ A throw statement must throw an expression. + 2 | throw + 3 | } + 4 |" +`; diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot index 79c7461a897..51974790455 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 8315b564721..ed482bcd2f9 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -3,30 +3,22 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` Object { "Babel errored but TSESTree didn't": Set { - "declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts", "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/kind-type/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts", - "declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts", "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", - "declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts", - "declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", - "declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts", - "declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture.ts", - "declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts", @@ -51,10 +43,7 @@ Object { "legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts", @@ -83,10 +72,8 @@ Object { "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", - "statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts", }, "TSESTree errored but Babel didn't": Set { "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts",