From f71e637081fa31b0e02f3f27377b456988abcba7 Mon Sep 17 00:00:00 2001 From: "bjz@Brads-MacBook-Pro.local" <> Date: Thu, 24 Nov 2022 14:54:26 +1030 Subject: [PATCH] =?UTF-8?q?fix(typescript-estree):=20stub=20out=20`ts.Sati?= =?UTF-8?q?sfiesExpression`=20on=20old=20TS=20versions=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## PR Checklist - [x] Steps in [CONTRIBUTING.md](https://github.com/typescript-eslint/typescript-eslint/blob/main/CONTRIBUTING.md) were taken ## Overview Another thing we need to add to the "new syntax" contributor guide. This union is part of the API surface for the package, so we need to ensure we don't break the build on old TS versions by "stubbing" out the new AST node types. Also added version comments so it's easy to tell when we can remove them as we bump the minimum TS version --- packages/typescript-estree/src/ts-estree/ts-nodes.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index 873f98e5a15..0ba5414e137 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -4,12 +4,18 @@ import type * as ts from 'typescript'; // Eg: https://github.com/typescript-eslint/typescript-eslint/issues/2388, https://github.com/typescript-eslint/typescript-eslint/issues/2784 declare module 'typescript' { /* eslint-disable @typescript-eslint/no-empty-interface */ + // added in TS 4.0 export interface NamedTupleMember extends ts.Node {} + // added in TS 4.1 export interface TemplateLiteralTypeNode extends ts.Node {} + // added in TS 4.3 export interface PrivateIdentifier extends ts.Node {} export interface ClassStaticBlockDeclaration extends ts.Node {} + // added in TS 4.5 export interface AssertClause extends ts.Node {} export interface AssertEntry extends ts.Node {} + // added in TS 4.9 + export interface SatisfiesExpression extends ts.Node {} /* eslint-enable @typescript-eslint/no-empty-interface */ }