Content-Length: 10803 | pFad | http://github.com/typescript-eslint/typescript-eslint/pull/11283.diff

thub.com diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot index c0d2cc8c0600..d7da87a7a9d7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot @@ -29,8 +29,8 @@ end: { column: 6, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [80, 84], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot index bfef506c822e..2fc7fb8f35c0 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot @@ -38,10 +38,8 @@ Snapshot Diff: end: { column: 6, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [80, 84], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot index c79f24defb00..2449e4574bc0 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot @@ -39,8 +39,8 @@ end: { column: 6, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [80, 84], @@ -239,8 +239,8 @@ end: { column: 10, line: 7 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [117, 121], @@ -329,8 +329,8 @@ end: { column: 8, line: 10 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [146, 150], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot index f3c7150f41d1..fed3e2747887 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot @@ -29,8 +29,8 @@ end: { column: 10, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [84, 88], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot index d17773cf1d68..c5d1e3db16f5 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot @@ -49,8 +49,8 @@ end: { column: 19, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [93, 97], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot index d746756b46c1..1270fb2681e8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot @@ -58,10 +58,8 @@ Snapshot Diff: end: { column: 19, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [93, 97], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot index 19f272b4f0a1..8e7e2549262f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot @@ -89,8 +89,8 @@ end: { column: 40, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [114, 118], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot index 56c8590cf6bb..56f0dedb193b 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot @@ -98,10 +98,8 @@ Snapshot Diff: end: { column: 40, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [114, 118], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot index a22433f5c8ca..f33dd4aed51b 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot @@ -249,8 +249,8 @@ end: { column: 23, line: 5 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [139, 143], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot index c5159511416e..547dd756f9d3 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot @@ -49,8 +49,8 @@ end: { column: 19, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [93, 97], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot index f8ff003d5c8e..0f245d08a17f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot @@ -58,10 +58,8 @@ Snapshot Diff: end: { column: 19, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [93, 97], diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot index fc6544193cf1..6afa608f53fd 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot @@ -76,12 +76,10 @@ exports[`AST Fixtures > List fixtures with Token differences`] "legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts", "legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts", "legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts", - "legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts", "legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts", - "legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts", "legacy-fixtures/basics/fixtures/typed-this/fixture.ts", "legacy-fixtures/basics/fixtures/union-intersection/fixture.ts", "legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts", @@ -111,7 +109,6 @@ exports[`AST Fixtures > List fixtures with Token differences`] "legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts", "legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts", "legacy-fixtures/types/fixtures/mapped/fixture.ts", - "legacy-fixtures/types/fixtures/nested-types/fixture.ts", "legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts", "legacy-fixtures/types/fixtures/reference-generic/fixture.ts", "legacy-fixtures/types/fixtures/reference/fixture.ts", diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index f2f60c777bd1..16054dfc9960 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -477,6 +477,9 @@ export function isChildUnwrappableOptionalChain( export function getTokenType( token: ts.Identifier | ts.Token, ): Exclude { + if (token.kind === SyntaxKind.NullKeyword) { + return AST_TOKEN_TYPES.Null; + } let keywordKind: ts.SyntaxKind | undefined; if (isAtLeast50 && token.kind === SyntaxKind.Identifier) { keywordKind = ts.identifierToKeywordKind(token as ts.Identifier);








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/typescript-eslint/typescript-eslint/pull/11283.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy