From 2f0c6ac62b797e2e57393962ae315078c6811a03 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 16 Sep 2025 22:41:04 +0800 Subject: [PATCH 1/9] chore(typescript-estree): simplify `convertImportAttributes` (#11594) * chore(typescript-estree): simplify `convertImportAttributes` * typo --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- packages/typescript-estree/src/convert.ts | 25 ++++++++--------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 0ffc735c3a14..ee7c128aca06 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -795,11 +795,13 @@ export class Converter { } private convertImportAttributes( - node: ts.ImportAttributes | undefined, + node: ts.ExportDeclaration | ts.ImportDeclaration, ): TSESTree.ImportAttribute[] { - return node == null - ? [] - : node.elements.map(element => this.convertChild(element)); + // eslint-disable-next-line @typescript-eslint/no-deprecated + const attributes = node.attributes ?? node.assertClause; + return ( + attributes?.elements.map(element => this.convertChild(element)) ?? [] + ); } private convertJSXIdentifier( @@ -2180,10 +2182,7 @@ export class Converter { this.#withDeprecatedAliasGetter( { type: AST_NODE_TYPES.ImportDeclaration, - attributes: this.convertImportAttributes( - // eslint-disable-next-line @typescript-eslint/no-deprecated - node.attributes ?? node.assertClause, - ), + attributes: this.convertImportAttributes(node), importKind: 'value', source: this.convertChild(node.moduleSpecifier), specifiers: [], @@ -2261,10 +2260,7 @@ export class Converter { this.#withDeprecatedAliasGetter( { type: AST_NODE_TYPES.ExportNamedDeclaration, - attributes: this.convertImportAttributes( - // eslint-disable-next-line @typescript-eslint/no-deprecated - node.attributes ?? node.assertClause, - ), + attributes: this.convertImportAttributes(node), declaration: null, exportKind: node.isTypeOnly ? 'type' : 'value', source: this.convertChild(node.moduleSpecifier), @@ -2284,10 +2280,7 @@ export class Converter { this.#withDeprecatedAliasGetter( { type: AST_NODE_TYPES.ExportAllDeclaration, - attributes: this.convertImportAttributes( - // eslint-disable-next-line @typescript-eslint/no-deprecated - node.attributes ?? node.assertClause, - ), + attributes: this.convertImportAttributes(node), exported: node.exportClause?.kind === SyntaxKind.NamespaceExport ? this.convertChild(node.exportClause.name) From 328a96de48e753174b0e934dbb5504937f246189 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 22 Sep 2025 20:49:11 +0800 Subject: [PATCH 2/9] chore(typescript-estree): add `Converter#convertChildren()` (#11592) * refactor(typescript-estree): add `Converter#covertChildren()` * Linting * Fix --- packages/typescript-estree/src/convert.ts | 111 +++++++++++----------- 1 file changed, 54 insertions(+), 57 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index ee7c128aca06..6fd3f245f87c 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -643,6 +643,19 @@ export class Converter { return this.converter(child, parent, false); } + /** + * Converts TypeScript node array into an ESTree node list. + * @param children the child `ts.NodeArray` or `ts.Node[]` + * @param parent parentNode + * @returns the converted ESTree node list + */ + private convertChildren( + children: ts.Node[] | ts.NodeArray, + parent?: ts.Node, + ): any[] { + return children.map(child => this.converter(child, parent, false)); + } + /** * Converts a TypeScript node into an ESTree node. * @param child the child ts.Node @@ -702,9 +715,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.TSTypeParameterInstantiation, range, - params: typeArguments.map(typeArgument => - this.convertChild(typeArgument), - ), + params: this.convertChildren(typeArguments), }); } @@ -730,9 +741,7 @@ export class Converter { type: AST_NODE_TYPES.TSTypeParameterDeclaration, loc: getLocFor(range, this.ast), range, - params: typeParameters.map(typeParameter => - this.convertChild(typeParameter), - ), + params: this.convertChildren(typeParameters), } as TSESTree.TSTypeParameterDeclaration; } @@ -750,8 +759,9 @@ export class Converter { return parameters.map(param => { const convertedParam = this.convertChild(param) as TSESTree.Parameter; - convertedParam.decorators = - getDecorators(param)?.map(el => this.convertChild(el)) ?? []; + convertedParam.decorators = this.convertChildren( + getDecorators(param) ?? [], + ); return convertedParam; }); @@ -799,9 +809,7 @@ export class Converter { ): TSESTree.ImportAttribute[] { // eslint-disable-next-line @typescript-eslint/no-deprecated const attributes = node.attributes ?? node.assertClause; - return ( - attributes?.elements.map(element => this.convertChild(element)) ?? [] - ); + return this.convertChildren(attributes?.elements ?? []); } private convertJSXIdentifier( @@ -1062,7 +1070,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.SwitchStatement, - cases: node.caseBlock.clauses.map(el => this.convertChild(el)), + cases: this.convertChildren(node.caseBlock.clauses), discriminant: this.convertChild(node.expression), }); @@ -1071,7 +1079,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.SwitchCase, // expression is present in case only - consequent: node.statements.map(el => this.convertChild(el)), + consequent: this.convertChildren(node.statements), test: node.kind === SyntaxKind.CaseClause ? this.convertChild(node.expression) @@ -1261,9 +1269,7 @@ export class Converter { case SyntaxKind.VariableStatement: { const result = this.createNode(node, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarationList.declarations.map(el => - this.convertChild(el), - ), + declarations: this.convertChildren(node.declarationList.declarations), declare: hasModifier(SyntaxKind.DeclareKeyword, node), kind: getDeclarationKind(node.declarationList), }); @@ -1340,7 +1346,7 @@ export class Converter { case SyntaxKind.VariableDeclarationList: { const result = this.createNode(node, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarations.map(el => this.convertChild(el)), + declarations: this.convertChildren(node.declarations), declare: false, kind: getDeclarationKind(node), }); @@ -1391,7 +1397,7 @@ export class Converter { } return this.createNode(node, { type: AST_NODE_TYPES.ArrayExpression, - elements: node.elements.map(el => this.convertChild(el)), + elements: this.convertChildren(node.elements), }); } @@ -1553,8 +1559,7 @@ export class Converter { accessibility: getTSNodeAccessibility(node), computed: isComputedProperty(node.name), declare: hasModifier(SyntaxKind.DeclareKeyword, node), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + decorators: this.convertChildren(getDecorators(node) ?? []), definite: !!node.exclamationToken, key, optional: @@ -1616,7 +1621,7 @@ export class Converter { | TSESTree.TSAbstractMethodDefinition; if (parent.kind === SyntaxKind.ObjectLiteralExpression) { - method.params = node.parameters.map(el => this.convertChild(el)); + method.params = this.convertChildren(node.parameters); result = this.createNode(node, { type: AST_NODE_TYPES.Property, @@ -1652,8 +1657,7 @@ export class Converter { type: methodDefinitionType, accessibility: getTSNodeAccessibility(node), computed: isComputedProperty(node.name), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + decorators: this.convertChildren(getDecorators(node) ?? []), key: this.convertChild(node.name), kind: 'method', optional: !!node.questionToken, @@ -2135,16 +2139,14 @@ export class Converter { body: this.createNode(node, { type: AST_NODE_TYPES.ClassBody, range: [node.members.pos - 1, node.end], - body: node.members - .filter(isESTreeClassMember) - .map(el => this.convertChild(el)), + body: this.convertChildren( + node.members.filter(isESTreeClassMember), + ), }), declare: hasModifier(SyntaxKind.DeclareKeyword, node), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + decorators: this.convertChildren(getDecorators(node) ?? []), id: this.convertChild(node.name), - implements: - implementsClause?.types.map(el => this.convertChild(el)) ?? [], + implements: this.convertChildren(implementsClause?.types ?? []), superClass: extendsClause?.types[0] ? this.convertChild(extendsClause.types[0].expression) : null, @@ -2218,9 +2220,9 @@ export class Converter { break; case SyntaxKind.NamedImports: result.specifiers.push( - ...node.importClause.namedBindings.elements.map( - el => this.convertChild(el) as TSESTree.ImportClause, - ), + ...(this.convertChildren( + node.importClause.namedBindings.elements, + ) as TSESTree.ImportClause[]), ); break; } @@ -2264,8 +2266,9 @@ export class Converter { declaration: null, exportKind: node.isTypeOnly ? 'type' : 'value', source: this.convertChild(node.moduleSpecifier), - specifiers: node.exportClause.elements.map(el => - this.convertChild(el, node), + specifiers: this.convertChildren( + node.exportClause.elements, + node, ), }, 'assertions', @@ -2501,7 +2504,7 @@ export class Converter { } const callee = this.convertChild(node.expression); - const args = node.arguments.map(el => this.convertChild(el)); + const args = this.convertChildren(node.arguments); const typeArguments = node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation( @@ -2531,9 +2534,7 @@ export class Converter { // NOTE - NewExpression cannot have an optional chain in it return this.createNode(node, { type: AST_NODE_TYPES.NewExpression, - arguments: node.arguments - ? node.arguments.map(el => this.convertChild(el)) - : [], + arguments: this.convertChildren(node.arguments ?? []), callee: this.convertChild(node.expression), typeArguments, }); @@ -2671,7 +2672,7 @@ export class Converter { case SyntaxKind.JsxElement: return this.createNode(node, { type: AST_NODE_TYPES.JSXElement, - children: node.children.map(el => this.convertChild(el)), + children: this.convertChildren(node.children), closingElement: this.convertChild(node.closingElement), openingElement: this.convertChild(node.openingElement), }); @@ -2679,7 +2680,7 @@ export class Converter { case SyntaxKind.JsxFragment: return this.createNode(node, { type: AST_NODE_TYPES.JSXFragment, - children: node.children.map(el => this.convertChild(el)), + children: this.convertChildren(node.children), closingFragment: this.convertChild(node.closingFragment), openingFragment: this.convertChild(node.openingFragment), }); @@ -2696,9 +2697,7 @@ export class Converter { openingElement: this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, range: getRange(node, this.ast), - attributes: node.attributes.properties.map(el => - this.convertChild(el), - ), + attributes: this.convertChildren(node.attributes.properties), name: this.convertJSXTagName(node.tagName, node), selfClosing: true, typeArguments: node.typeArguments @@ -2714,9 +2713,7 @@ export class Converter { case SyntaxKind.JsxOpeningElement: { return this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, - attributes: node.attributes.properties.map(el => - this.convertChild(el), - ), + attributes: this.convertChildren(node.attributes.properties), name: this.convertJSXTagName(node.tagName, node), selfClosing: false, typeArguments: @@ -2859,7 +2856,7 @@ export class Converter { case SyntaxKind.TypeLiteral: { return this.createNode(node, { type: AST_NODE_TYPES.TSTypeLiteral, - members: node.members.map(el => this.convertChild(el)), + members: this.convertChildren(node.members), }); } @@ -2983,7 +2980,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.TSIndexSignature, accessibility: getTSNodeAccessibility(node), - parameters: node.parameters.map(el => this.convertChild(el)), + parameters: this.convertChildren(node.parameters), readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node), static: hasModifier(SyntaxKind.StaticKeyword, node), typeAnnotation: @@ -3109,7 +3106,7 @@ export class Converter { body: this.createNode(node, { type: AST_NODE_TYPES.TSInterfaceBody, range: [node.members.pos - 1, node.end], - body: node.members.map(member => this.convertChild(member)), + body: this.convertChildren(node.members), }), declare: hasModifier(SyntaxKind.DeclareKeyword, node), extends: interfaceExtends, @@ -3245,7 +3242,7 @@ export class Converter { } case SyntaxKind.EnumDeclaration: { - const members = node.members.map(el => this.convertChild(el)); + const members = this.convertChildren(node.members); const result = this.createNode( node, this.#withDeprecatedGetter( @@ -3262,7 +3259,7 @@ export class Converter { }, 'members', `'body.members'`, - node.members.map(el => this.convertChild(el)), + this.convertChildren(node.members), ), ); @@ -3439,13 +3436,13 @@ export class Converter { case SyntaxKind.UnionType: { return this.createNode(node, { type: AST_NODE_TYPES.TSUnionType, - types: node.types.map(el => this.convertChild(el)), + types: this.convertChildren(node.types), }); } case SyntaxKind.IntersectionType: { return this.createNode(node, { type: AST_NODE_TYPES.TSIntersectionType, - types: node.types.map(el => this.convertChild(el)), + types: this.convertChildren(node.types), }); } case SyntaxKind.AsExpression: { @@ -3519,7 +3516,7 @@ export class Converter { // Tuple case SyntaxKind.TupleType: { - const elementTypes = node.elements.map(el => this.convertChild(el)); + const elementTypes = this.convertChildren(node.elements); return this.createNode(node, { type: AST_NODE_TYPES.TSTupleType, @@ -3678,7 +3675,7 @@ export class Converter { } const decorators = getDecorators(node); if (decorators?.length) { - result.decorators = decorators.map(el => this.convertChild(el)); + result.decorators = this.convertChildren(decorators); } // keys we never want to clone from the base typescript node as they @@ -3710,7 +3707,7 @@ export class Converter { .filter(([key]) => !KEYS_TO_NOT_COPY.has(key)) .forEach(([key, value]) => { if (Array.isArray(value)) { - result[key] = value.map(el => this.convertChild(el as TSNode)); + result[key] = this.convertChildren(value); } else if (value && typeof value === 'object' && value.kind) { // need to check node[key].kind to ensure we don't try to convert a symbol result[key] = this.convertChild(value as TSNode); From fde540eef7f69f9364f686fddd690a857edda1f5 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 22 Sep 2025 20:49:31 +0800 Subject: [PATCH 3/9] fix(typescript-estree): forbid class property with name `constructor` (#11590) * fix(typescript-estree): forbid class property with name `constructor` * Format fixtures --- .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ .../key-constructor-identifier/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 82 ++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 82 ++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 82 ++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 82 ++++++++++++++ .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 102 ++++++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 102 ++++++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 102 ++++++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 102 ++++++++++++++++++ .../key-constructor-identifier/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ packages/typescript-estree/src/convert.ts | 10 ++ 81 files changed, 3022 insertions(+) create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..fe9d09f5c8b5 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1efee502ef1a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | accessor '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..b36c85229b5d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | accessor '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1b975851c82a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..15b65f9026f1 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor 'constructor' +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..99225f26fe0f --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | accessor 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..bb359842fe1e --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | accessor 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d6b1cda3e19b --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..176558f7f971 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor [constructor]; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0bd9d71a1338 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [10, 39], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ced41a5029ae --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0bd9d71a1338 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [10, 39], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ced41a5029ae --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..acc5cfe6398a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor ['constructor']; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5b9bbadd0d07 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [10, 41], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..30151a9636c9 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5b9bbadd0d07 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [10, 41], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..30151a9636c9 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts new file mode 100644 index 000000000000..581943685ffe --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + constructor +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ed0ae4b78658 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > TSESTree - Error`] +TSError + 1 | class Foo { + 2 | constructor +> 3 | } + | ^ '(' expected. + 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..680ca51c5b1a --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | constructor + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..dda789130572 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..5dc0386f85fe --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..53cc50de6a35 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..130b27dcc413 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..b3922ac52bf5 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..d29a35ffdbb7 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + 'constructor' +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..46f1efa8ad71 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..eaac47437927 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..86e611b5b35d --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..8846529091d9 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + [constructor]; +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..036f1181e9b7 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [10, 30], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..93100d49782c --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [26, 27], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..036f1181e9b7 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [10, 30], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..93100d49782c --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [26, 27], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..955e0ccdd551 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + ['constructor']; +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a35a705153a3 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 30], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [10, 32], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d587dd5c180d --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a35a705153a3 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 30], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [10, 32], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d587dd5c180d --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..2d83385d93bf --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..e2a98ea43e52 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | accessor '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..73035ad32ef8 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | accessor '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..f4851859171d --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..84fb8c4caa3f --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor 'constructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..97e1650fccca --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | accessor 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..9f0cd2ea63f0 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | accessor 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c6bb852e8a96 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..e267f66d845d --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor [constructor]; +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..82d28f21758a --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 46], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [19, 48], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4941bcdc220c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [45, 46], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [47, 48], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..82d28f21758a --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 46], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [19, 48], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..4941bcdc220c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [45, 46], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [47, 48], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..dd4af2978b06 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor ['constructor']; +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c1ef23b02e88 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 48], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [19, 50], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 50], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b3c97ec3fd6c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [46, 47], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [49, 50], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c1ef23b02e88 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 48], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [19, 50], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 50], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b3c97ec3fd6c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [46, 47], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [49, 50], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts new file mode 100644 index 000000000000..a70cc4d0b84e --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + constructor +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..d4dac96c3819 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > TSESTree - Error`] +TSError + 1 | abstract class Foo { + 2 | constructor +> 3 | } + | ^ '(' expected. + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..40ef5d1ba178 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | constructor + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c03db2425706 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..3964b6ad536d --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..832a69aba874 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..972fa63aaaf7 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c784e6ef8f7e --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..773be1c59705 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + 'constructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..e70630a8db65 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..0b562418bd7a --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..e72b64ca43be --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..0035d60f9a3b --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + [constructor]; +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a84556365ffa --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [19, 39], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f33b1b154313 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a84556365ffa --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [19, 39], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f33b1b154313 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..d7fa2a53c79b --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + ['constructor']; +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..880411e5b0a1 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [19, 41], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a82ebf95ff87 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..880411e5b0a1 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [19, 41], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a82ebf95ff87 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 6fd3f245f87c..bec26fede610 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1532,6 +1532,16 @@ export class Converter { ); } + if ( + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' + ) { + this.#throwError( + node.name, + "Classes may not have a field named 'constructor'.", + ); + } + const isAccessor = hasModifier(SyntaxKind.AccessorKeyword, node); const type = (() => { if (isAccessor) { From 4fde781fdfeb38ac80256d20ac3d776479217b2d Mon Sep 17 00:00:00 2001 From: mdm317 Date: Mon, 22 Sep 2025 21:50:20 +0900 Subject: [PATCH 4/9] fix(eslint-plugin): [no-base-to-string] make ignoredTypeNames match type names without generics (#11597) fix: support generic in ignoreType --- .../src/rules/no-base-to-string.ts | 18 ++++++++++++++ .../tests/rules/no-base-to-string.test.ts | 24 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 26eadce99839..53d50bd4694f 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -25,6 +25,13 @@ export type Options = [ }, ]; export type MessageIds = 'baseArrayJoin' | 'baseToString'; +const canHaveTypeParameters = (declaration: ts.Declaration) => { + return ( + ts.isTypeAliasDeclaration(declaration) || + ts.isInterfaceDeclaration(declaration) || + ts.isClassDeclaration(declaration) + ); +}; export default createRule({ name: 'no-base-to-string', @@ -231,6 +238,17 @@ export default createRule({ return Usefulness.Always; } + const symbol = type.aliasSymbol ?? type.getSymbol(); + const decl = symbol?.getDeclarations()?.[0]; + if ( + decl && + canHaveTypeParameters(decl) && + decl.typeParameters && + ignoredTypeNames.includes(symbol.name) + ) { + return Usefulness.Always; + } + if (ignoredTypeNames.includes(getTypeName(checker, type))) { return Usefulness.Always; } diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index 8c61eda34e63..7e6fa055b55e 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -300,6 +300,30 @@ String(foo); `, options: [{ ignoredTypeNames: ['Foo'] }], }, + { + code: ` +interface MyError {} +declare const error: MyError; +error.toString(); + `, + options: [{ ignoredTypeNames: ['MyError'] }], + }, + { + code: ` +type MyError = {}; +declare const error: MyError; +error.toString(); + `, + options: [{ ignoredTypeNames: ['MyError'] }], + }, + { + code: ` +class MyError {} +declare const error: MyError; +error.toString(); + `, + options: [{ ignoredTypeNames: ['MyError'] }], + }, ` function String(value) { return value; From 20c3d97235956d7a5ea34c3e0c0be5e56d603575 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 22 Sep 2025 08:50:32 -0400 Subject: [PATCH 5/9] fix(eslint-plugin): [no-unsafe-enum-comparison] support unions of literals (#11599) * fix(eslint-plugin): [no-unsafe-enum-comparison] support unions of literals * lint fix --- .../src/rules/no-unsafe-enum-comparison.ts | 36 +++++---- .../rules/no-unsafe-enum-comparison.test.ts | 76 +++++++++++++++++++ 2 files changed, 98 insertions(+), 14 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts index c5f457db3618..051a827ee720 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts @@ -23,25 +23,33 @@ function typeViolates(leftTypeParts: ts.Type[], rightType: ts.Type): boolean { } function isNumberLike(type: ts.Type): boolean { - const typeParts = tsutils.intersectionConstituents(type); - - return typeParts.some(typePart => { - return tsutils.isTypeFlagSet( - typePart, - ts.TypeFlags.Number | ts.TypeFlags.NumberLike, + return tsutils + .unionConstituents(type) + .every(unionPart => + tsutils + .intersectionConstituents(unionPart) + .some(intersectionPart => + tsutils.isTypeFlagSet( + intersectionPart, + ts.TypeFlags.Number | ts.TypeFlags.NumberLike, + ), + ), ); - }); } function isStringLike(type: ts.Type): boolean { - const typeParts = tsutils.intersectionConstituents(type); - - return typeParts.some(typePart => { - return tsutils.isTypeFlagSet( - typePart, - ts.TypeFlags.String | ts.TypeFlags.StringLike, + return tsutils + .unionConstituents(type) + .every(unionPart => + tsutils + .intersectionConstituents(unionPart) + .some(intersectionPart => + tsutils.isTypeFlagSet( + intersectionPart, + ts.TypeFlags.String | ts.TypeFlags.StringLike, + ), + ), ); - }); } /** diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts index 89e28f163314..b10f3cc6ee5f 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts @@ -1165,5 +1165,81 @@ ruleTester.run('no-unsafe-enum-comparison', rule, { `, errors: [{ messageId: 'mismatchedCondition' }], }, + { + code: ` +enum NUMBER_ENUM { + First = 0, + Second = 1, +} + +type NumberUnion = 0 | 1; + +declare const numberUnion: NumberUnion; + +switch (numberUnion) { + case NUMBER_ENUM.First: + case NUMBER_ENUM.Second: + break; +} + `, + errors: [ + { + line: 12, + messageId: 'mismatchedCase', + }, + { + line: 13, + messageId: 'mismatchedCase', + }, + ], + }, + { + code: ` +enum STRING_ENUM { + First = 'one', + Second = 'two', +} + +type StringUnion = 'one' | 'two'; + +declare const stringUnion: StringUnion; + +switch (stringUnion) { + case STRING_ENUM.First: + case STRING_ENUM.Second: + break; +} + `, + errors: [ + { + line: 12, + messageId: 'mismatchedCase', + }, + { + line: 13, + messageId: 'mismatchedCase', + }, + ], + }, + { + code: ` +declare const stringUnion: 'foo' | 'bar'; + +enum StringEnum { + FOO = 'foo', + BAR = 'bar', +} + +declare const stringEnum: StringEnum; + +stringUnion === stringEnum; + `, + errors: [ + { + line: 11, + messageId: 'mismatchedCondition', + }, + ], + }, ], }); From e550780ba47f8ea2f7f65e01c1a86d978d161040 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:58:45 -0400 Subject: [PATCH 6/9] chore(deps): update dependency make-dir to v5.1.0 (#11612) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4aa74f3880d9..eb3130ba178c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13310,9 +13310,9 @@ __metadata: linkType: hard "make-dir@npm:*": - version: 5.0.0 - resolution: "make-dir@npm:5.0.0" - checksum: 9f40f4756af5138ca3b138f9e8af144b0420516e96b0e079d816a173d2f69b2ef3425abf20e25764d222c0939a9fd2bce91dd26c22002a559cd6beaea5c994d2 + version: 5.1.0 + resolution: "make-dir@npm:5.1.0" + checksum: 372abd9cbb2029bead4efe6c369c9af8ae77773d9a31ed5378fd7ae8072f06ea272aec5c7aba7543d3b8578a45b0bf90d86a78ab311afa4bc3446000977095a9 languageName: node linkType: hard From c392a0de2dba95ff24bc1f1730a8a85793d4d837 Mon Sep 17 00:00:00 2001 From: Ronen Amiel Date: Mon, 22 Sep 2025 19:00:09 +0300 Subject: [PATCH 7/9] fix(eslint-plugin): [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal (#11611) fix: do not report values that may be a promise in an array literal --- .../eslint-plugin/src/rules/await-thenable.ts | 15 ++++++++++++++- .../tests/rules/await-thenable.test.ts | 12 ++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index 8c84eacc8788..70c87cc5d918 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -111,7 +111,7 @@ export default createRule<[], MessageId>({ const type = getConstrainedTypeAtLocation(services, element); const tsNode = services.esTreeNodeToTSNodeMap.get(element); - if (containsNonAwaitableType(type, tsNode, checker)) { + if (isAlwaysNonAwaitableType(type, tsNode, checker)) { context.report({ node: element, messageId: 'invalidPromiseAggregatorInput', @@ -281,6 +281,19 @@ function getValueTypesOfArrayLike( return null; } +function isAlwaysNonAwaitableType( + type: ts.Type, + node: ts.Node, + checker: ts.TypeChecker, +): boolean { + return tsutils + .unionConstituents(type) + .every( + typeArgumentPart => + needsToBeAwaited(checker, node, typeArgumentPart) === Awaitable.Never, + ); +} + function containsNonAwaitableType( type: ts.Type, node: ts.Node, diff --git a/packages/eslint-plugin/tests/rules/await-thenable.test.ts b/packages/eslint-plugin/tests/rules/await-thenable.test.ts index f1729d908bdb..0556ce4803de 100644 --- a/packages/eslint-plugin/tests/rules/await-thenable.test.ts +++ b/packages/eslint-plugin/tests/rules/await-thenable.test.ts @@ -683,6 +683,18 @@ Promise.all([ Promise.resolve(2), Promise.resolve(3), ...[Promise.resolve(4), Promise.resolve(5), Promise.resolve(6)], +]); + `, + }, + { + code: ` +declare const maybePromise: Promise | number; + +Promise.all([ + maybePromise, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), ]); `, }, From e8b0b4d23800441decb15c2d3af32946fe63da9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 12:04:02 -0400 Subject: [PATCH 8/9] chore(deps): update dependency globals to v16.4.0 (#11610) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index eb3130ba178c..497a924121ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11079,9 +11079,9 @@ __metadata: linkType: hard "globals@npm:^16.0.0": - version: 16.3.0 - resolution: "globals@npm:16.3.0" - checksum: 2f3467f27bd84dca7778b0f7b528718b697274f3ed0d12721b9af0a14a9b6eb20240cb221817c264a27bfc5b9fac3ae28f6168b39808f27c74142942fb953c73 + version: 16.4.0 + resolution: "globals@npm:16.4.0" + checksum: 934180f5c6cbb26f8b2832caa255050fface970eee45bde8757fabba384807c85640a12716aa5bcc47d781807839fee470c8c1f6159c6b8dc877668c56103880 languageName: node linkType: hard From c1980522cd11f2de1a49ff6a30b4be7765a843ff Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 22 Sep 2025 17:04:37 +0000 Subject: [PATCH 9/9] chore(release): publish 8.44.1 --- CHANGELOG.md | 18 ++++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 16 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 224 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa5ceaaa6bea..8f7e3eb6e2db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **eslint-plugin:** [no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](https://github.com/typescript-eslint/typescript-eslint/pull/11597)) +- **eslint-plugin:** [no-unsafe-enum-comparison] support unions of literals ([#11599](https://github.com/typescript-eslint/typescript-eslint/pull/11599)) +- **eslint-plugin:** [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](https://github.com/typescript-eslint/typescript-eslint/pull/11611)) +- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Kirk Waiblinger @kirkwaiblinger +- mdm317 +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 4c7a8ba3e11c..fec4e2abcc96 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index e89e369e0bbe..788732adc36f 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.44.0", + "version": "8.44.1", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index b61c69fe769f..f12996c79142 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,19 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **eslint-plugin:** [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](https://github.com/typescript-eslint/typescript-eslint/pull/11611)) +- **eslint-plugin:** [no-unsafe-enum-comparison] support unions of literals ([#11599](https://github.com/typescript-eslint/typescript-eslint/pull/11599)) +- **eslint-plugin:** [no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](https://github.com/typescript-eslint/typescript-eslint/pull/11597)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger +- mdm317 +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index d78a1182c1ba..d01ee4e12e8b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.44.0", + "version": "8.44.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/type-utils": "8.44.0", - "@typescript-eslint/utils": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/scope-manager": "8.44.1", + "@typescript-eslint/type-utils": "8.44.1", + "@typescript-eslint/utils": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.44.0", - "@typescript-eslint/rule-tester": "8.44.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.44.1", + "@typescript-eslint/rule-tester": "8.44.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.44.0", + "@typescript-eslint/parser": "^8.44.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 8d1ea2c3c5a4..e8a3d8afcb46 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 19b621151505..8087809d4884 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.44.0", + "version": "8.44.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/scope-manager": "8.44.1", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 092a642891f9..55690ad57c69 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index da5b76225005..be0d5ba771fb 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.44.0", + "version": "8.44.1", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.44.0", - "@typescript-eslint/types": "^8.44.0", + "@typescript-eslint/tsconfig-utils": "^8.44.1", + "@typescript-eslint/types": "^8.44.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 7f895b5e5334..29320dcf7a2d 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index bbcbbfa3615f..8eee73cef414 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.44.0", + "version": "8.44.1", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.44.0", - "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/type-utils": "8.44.1", + "@typescript-eslint/utils": "8.44.1", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index fecac3bc3086..89c694b8fa62 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index c30c880998ec..9472a7d024b0 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.44.0", + "version": "8.44.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/parser": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/utils": "8.44.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 944dd764947f..8f5948ab1f82 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 719daddf8f67..22e2476b5b90 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.44.0", + "version": "8.44.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0" + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index e758fb5abd16..d4c37732a9f4 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index b112bc1bb021..fa1b2e343954 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.44.0", + "version": "8.44.1", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 6163c6f95df3..acc90600162d 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 997aa43dc724..a1b7b766950a 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.44.0", + "version": "8.44.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/utils": "8.44.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.44.0", + "@typescript-eslint/parser": "8.44.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 9ab94998069d..75911ee3b7f0 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 824ae019c24b..e531f0e52f24 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.44.0", + "version": "8.44.1", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 92fdc7a6bc41..ea0fe52260b5 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 55d767d36490..9b2cae39fca3 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.44.0", + "version": "8.44.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.44.0", - "@typescript-eslint/parser": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/utils": "8.44.0" + "@typescript-eslint/eslint-plugin": "8.44.1", + "@typescript-eslint/parser": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/utils": "8.44.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index bec95ad0397e..d22e93409134 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 02d35fb5449e..82432de9dcf6 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.44.0", + "version": "8.44.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.44.0", - "@typescript-eslint/tsconfig-utils": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/project-service": "8.44.1", + "@typescript-eslint/tsconfig-utils": "8.44.1", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 6fb0ea01611e..e9d6aa34c615 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 92d1f49bda3f..8ea3a0308748 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.44.0", + "version": "8.44.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0" + "@typescript-eslint/scope-manager": "8.44.1", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 561af2e738aa..5516fc1c32fc 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index c48f8b7eba69..0691965d0401 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.44.0", + "version": "8.44.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/types": "8.44.1", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 497a924121ce..dc5062b5cb69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5830,19 +5830,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.44.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.44.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.44.0 - "@typescript-eslint/rule-tester": 8.44.0 - "@typescript-eslint/scope-manager": 8.44.0 - "@typescript-eslint/type-utils": 8.44.0 - "@typescript-eslint/utils": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.44.1 + "@typescript-eslint/rule-tester": 8.44.1 + "@typescript-eslint/scope-manager": 8.44.1 + "@typescript-eslint/type-utils": 8.44.1 + "@typescript-eslint/utils": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5865,7 +5865,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.44.0 + "@typescript-eslint/parser": ^8.44.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5881,14 +5881,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.44.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.44.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/scope-manager": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5902,12 +5902,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.44.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.44.1, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.44.0 - "@typescript-eslint/types": ^8.44.0 + "@typescript-eslint/tsconfig-utils": ^8.44.1 + "@typescript-eslint/types": ^8.44.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5918,12 +5918,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.44.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.44.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/type-utils": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5934,15 +5934,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.44.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.44.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/parser": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5957,13 +5957,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.44.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.44.1, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5974,7 +5974,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.44.0, @typescript-eslint/tsconfig-utils@^8.44.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.44.1, @typescript-eslint/tsconfig-utils@^8.44.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5987,14 +5987,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.44.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.44.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/parser": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6009,7 +6009,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.44.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.44.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.44.1, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.44.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6082,15 +6082,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.44.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.44.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.44.0 - "@typescript-eslint/tsconfig-utils": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/project-service": 8.44.1 + "@typescript-eslint/tsconfig-utils": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6108,14 +6108,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.44.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.44.1, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/scope-manager": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6127,11 +6127,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.44.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.44.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/types": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19360,10 +19360,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.44.0 - "@typescript-eslint/parser": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/eslint-plugin": 8.44.1 + "@typescript-eslint/parser": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*"