Skip to content

Commit f62baec

Browse files
chore(ast-spec): simplify Literal types (typescript-eslint#3769)
1 parent a46e318 commit f62baec

File tree

7 files changed

+2
-12
lines changed

7 files changed

+2
-12
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import type { AST_NODE_TYPES } from '../ast-node-types';
12
import type { BaseNode } from './BaseNode';
23

34
export interface LiteralBase extends BaseNode {
5+
type: AST_NODE_TYPES.Literal;
46
raw: string;
57
value: RegExp | bigint | boolean | number | string | null;
68
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { AST_NODE_TYPES } from '../../../ast-node-types';
21
import type { LiteralBase } from '../../../base/LiteralBase';
32

43
export interface BigIntLiteral extends LiteralBase {
5-
type: AST_NODE_TYPES.Literal;
64
value: bigint | null;
75
bigint: string;
86
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { AST_NODE_TYPES } from '../../../ast-node-types';
21
import type { LiteralBase } from '../../../base/LiteralBase';
32

43
export interface BooleanLiteral extends LiteralBase {
5-
type: AST_NODE_TYPES.Literal;
64
value: boolean;
75
raw: 'false' | 'true';
86
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { AST_NODE_TYPES } from '../../../ast-node-types';
21
import type { LiteralBase } from '../../../base/LiteralBase';
32

43
export interface NullLiteral extends LiteralBase {
5-
type: AST_NODE_TYPES.Literal;
64
value: null;
75
raw: 'null';
86
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import type { AST_NODE_TYPES } from '../../../ast-node-types';
21
import type { LiteralBase } from '../../../base/LiteralBase';
32

43
export interface NumberLiteral extends LiteralBase {
5-
type: AST_NODE_TYPES.Literal;
64
value: number;
75
}

packages/ast-spec/src/expression/literal/RegExpLiteral/spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { AST_NODE_TYPES } from '../../../ast-node-types';
21
import type { LiteralBase } from '../../../base/LiteralBase';
32

43
export interface RegExpLiteral extends LiteralBase {
5-
type: AST_NODE_TYPES.Literal;
64
value: RegExp | null;
75
regex: {
86
pattern: string;
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import type { AST_NODE_TYPES } from '../../../ast-node-types';
21
import type { LiteralBase } from '../../../base/LiteralBase';
32

43
export interface StringLiteral extends LiteralBase {
5-
type: AST_NODE_TYPES.Literal;
64
value: string;
75
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy