From 52b9efae1ad9bc21e97ac9f33d0e2afe4029422a Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 4 Jan 2024 10:31:20 +1030 Subject: [PATCH 1/2] fix(typescript-estree): fix incorrect backwards-compat augmentation in TS 5.3 --- packages/typescript-estree/src/ts-estree/ts-nodes.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index 5bf6af81a9f5..2a07ee0e7eac 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -2,12 +2,11 @@ import type * as ts from 'typescript'; // Workaround to support new TS version features for consumers on old TS versions // Eg: https://github.com/typescript-eslint/typescript-eslint/issues/2388, https://github.com/typescript-eslint/typescript-eslint/issues/2784 -/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/no-empty-interface */ declare module 'typescript' { - /** @ts-ignore - added in TS 4.5, deprecated and converted to a type-alias in TS 5.3 */ - export interface AssertClause extends ts.Node {} - /** @ts-ignore - added in TS 4.5, deprecated and converted to a type-alias in TS 5.3 */ - export interface AssertEntry extends ts.Node {} + // added in TS 4.5, deprecated in TS 5.3 + export interface AssertClause extends ts.ImportAttributes {} + export interface AssertEntry extends ts.ImportAttribute {} // added in TS 4.9 export interface SatisfiesExpression extends ts.Node {} // added in TS 5.1 @@ -16,7 +15,7 @@ declare module 'typescript' { export interface ImportAttribute extends ts.Node {} export interface ImportAttributes extends ts.Node {} } -/* eslint-enable @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/no-empty-interface */ +/* eslint-enable @typescript-eslint/no-empty-interface */ export type TSToken = ts.Token; From b37b4b3449453fdcc26e7c5d1397bc59ece53f0f Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 13 Jan 2024 13:55:27 +1030 Subject: [PATCH 2/2] fix lint error? --- packages/typescript-estree/src/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 08c29892e220..ffa0c4212295 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -244,7 +244,7 @@ function parseAndGenerateServices( options.filePath && parseAndGenerateServicesCalls[options.filePath] > 1 ? createIsolatedProgram(parseSettings) - : getProgramAndAST(parseSettings, hasFullTypeInformation)!; + : getProgramAndAST(parseSettings, hasFullTypeInformation); /** * Convert the TypeScript AST to an ESTree-compatible one, and optionally preserve