Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ast-spec): remove more invalid properties #6243

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/ast-spec/src/base/MethodDefinitionBase.ts
@@ -1,7 +1,6 @@
import type { FunctionExpression } from '../expression/FunctionExpression/spec';
import type { TSEmptyBodyFunctionExpression } from '../expression/TSEmptyBodyFunctionExpression/spec';
import type { Decorator } from '../special/Decorator/spec';
import type { TSTypeParameterDeclaration } from '../special/TSTypeParameterDeclaration/spec';
import type {
ClassPropertyNameNonComputed,
PropertyName,
Expand All @@ -21,7 +20,6 @@ interface MethodDefinitionBase extends BaseNode {
optional?: boolean;
decorators?: Decorator[];
accessibility?: Accessibility;
typeParameters?: TSTypeParameterDeclaration;
override?: boolean;
}

Expand Down
1 change: 0 additions & 1 deletion packages/ast-spec/src/element/TSIndexSignature/spec.ts
Expand Up @@ -10,6 +10,5 @@ export interface TSIndexSignature extends BaseNode {
typeAnnotation?: TSTypeAnnotation;
readonly?: boolean;
accessibility?: Accessibility;
export?: boolean;
static?: boolean;
}
1 change: 0 additions & 1 deletion packages/ast-spec/src/element/TSMethodSignature/spec.ts
Expand Up @@ -20,7 +20,6 @@ interface TSMethodSignatureBase extends BaseNode {
readonly?: boolean;
typeParameters?: TSTypeParameterDeclaration;
accessibility?: Accessibility;
export?: boolean;
static?: boolean;
kind: 'get' | 'method' | 'set';
}
Expand Down
3 changes: 0 additions & 3 deletions packages/ast-spec/src/element/TSPropertySignature/spec.ts
Expand Up @@ -2,7 +2,6 @@ import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { Accessibility } from '../../base/Accessibility';
import type { BaseNode } from '../../base/BaseNode';
import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
import type { Expression } from '../../unions/Expression';
import type {
PropertyName,
PropertyNameComputed,
Expand All @@ -15,10 +14,8 @@ interface TSPropertySignatureBase extends BaseNode {
optional?: boolean;
computed: boolean;
typeAnnotation?: TSTypeAnnotation;
initializer?: Expression;
readonly?: boolean;
static?: boolean;
export?: boolean;
accessibility?: Accessibility;
}

Expand Down
Expand Up @@ -11,7 +11,6 @@ export interface TSParameterProperty extends BaseNode {
accessibility?: Accessibility;
readonly?: boolean;
static?: boolean;
export?: boolean;
override?: boolean;
parameter: AssignmentPattern | BindingName | RestElement;
decorators?: Decorator[];
Expand Down
15 changes: 0 additions & 15 deletions packages/typescript-estree/src/convert.ts
Expand Up @@ -673,10 +673,6 @@ export class Converter {
result.accessibility = accessibility;
}

if (hasModifier(SyntaxKind.ExportKeyword, node)) {
result.export = true;
}

if (hasModifier(SyntaxKind.StaticKeyword, node)) {
result.static = true;
}
Expand Down Expand Up @@ -1632,7 +1628,6 @@ export class Converter {
readonly:
hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
static: hasModifier(SyntaxKind.StaticKeyword, node) || undefined,
export: hasModifier(SyntaxKind.ExportKeyword, node) || undefined,
override:
hasModifier(SyntaxKind.OverrideKeyword, node) || undefined,
parameter: result,
Expand Down Expand Up @@ -2484,14 +2479,8 @@ export class Converter {
typeAnnotation: node.type
? this.convertTypeAnnotation(node.type, node)
: undefined,
initializer:
this.convertChild(
// eslint-disable-next-line deprecation/deprecation -- TODO breaking change remove this from the AST
node.initializer,
) || undefined,
readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
static: hasModifier(SyntaxKind.StaticKeyword, node) || undefined,
export: hasModifier(SyntaxKind.ExportKeyword, node) || undefined,
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
});

const accessibility = getTSNodeAccessibility(node);
Expand Down Expand Up @@ -2521,10 +2510,6 @@ export class Converter {
result.accessibility = accessibility;
}

if (hasModifier(SyntaxKind.ExportKeyword, node)) {
result.export = true;
}

if (hasModifier(SyntaxKind.StaticKeyword, node)) {
result.static = true;
}
Expand Down
Expand Up @@ -126,8 +126,6 @@ Object {
"members": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down
Expand Up @@ -80,7 +80,6 @@ Object {
"params": Array [
Object {
"accessibility": "protected",
"export": undefined,
"loc": Object {
"end": Object {
"column": 55,
Expand Down
Expand Up @@ -134,7 +134,6 @@ Object {
"params": Array [
Object {
"accessibility": undefined,
"export": undefined,
"loc": Object {
"end": Object {
"column": 36,
Expand Down
Expand Up @@ -80,7 +80,6 @@ Object {
"params": Array [
Object {
"accessibility": undefined,
"export": true,
"loc": Object {
"end": Object {
"column": 32,
Expand Down
Expand Up @@ -80,7 +80,6 @@ Object {
"params": Array [
Object {
"accessibility": "private",
"export": undefined,
"loc": Object {
"end": Object {
"column": 39,
Expand Down Expand Up @@ -154,7 +153,6 @@ Object {
},
Object {
"accessibility": "private",
"export": undefined,
"loc": Object {
"end": Object {
"column": 47,
Expand Down Expand Up @@ -228,7 +226,6 @@ Object {
},
Object {
"accessibility": "private",
"export": undefined,
"loc": Object {
"end": Object {
"column": 38,
Expand Down Expand Up @@ -338,7 +335,6 @@ Object {
},
Object {
"accessibility": "private",
"export": undefined,
"loc": Object {
"end": Object {
"column": 55,
Expand Down
Expand Up @@ -80,7 +80,6 @@ Object {
"params": Array [
Object {
"accessibility": "protected",
"export": undefined,
"loc": Object {
"end": Object {
"column": 41,
Expand Down Expand Up @@ -154,7 +153,6 @@ Object {
},
Object {
"accessibility": "protected",
"export": undefined,
"loc": Object {
"end": Object {
"column": 49,
Expand Down Expand Up @@ -228,7 +226,6 @@ Object {
},
Object {
"accessibility": "protected",
"export": undefined,
"loc": Object {
"end": Object {
"column": 40,
Expand Down Expand Up @@ -338,7 +335,6 @@ Object {
},
Object {
"accessibility": "protected",
"export": undefined,
"loc": Object {
"end": Object {
"column": 57,
Expand Down
Expand Up @@ -80,7 +80,6 @@ Object {
"params": Array [
Object {
"accessibility": "public",
"export": undefined,
"loc": Object {
"end": Object {
"column": 38,
Expand Down Expand Up @@ -154,7 +153,6 @@ Object {
},
Object {
"accessibility": "public",
"export": undefined,
"loc": Object {
"end": Object {
"column": 46,
Expand Down Expand Up @@ -228,7 +226,6 @@ Object {
},
Object {
"accessibility": "public",
"export": undefined,
"loc": Object {
"end": Object {
"column": 37,
Expand Down Expand Up @@ -338,7 +335,6 @@ Object {
},
Object {
"accessibility": "public",
"export": undefined,
"loc": Object {
"end": Object {
"column": 54,
Expand Down
Expand Up @@ -80,7 +80,6 @@ Object {
"params": Array [
Object {
"accessibility": undefined,
"export": undefined,
"loc": Object {
"end": Object {
"column": 40,
Expand Down Expand Up @@ -154,7 +153,6 @@ Object {
},
Object {
"accessibility": undefined,
"export": undefined,
"loc": Object {
"end": Object {
"column": 49,
Expand Down
Expand Up @@ -80,7 +80,6 @@ Object {
"params": Array [
Object {
"accessibility": undefined,
"export": undefined,
"loc": Object {
"end": Object {
"column": 32,
Expand Down
Expand Up @@ -216,8 +216,6 @@ Object {
"members": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down Expand Up @@ -291,8 +289,6 @@ Object {
},
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down
Expand Up @@ -216,8 +216,6 @@ Object {
"members": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down Expand Up @@ -291,8 +289,6 @@ Object {
},
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down
Expand Up @@ -8,8 +8,6 @@ Object {
"body": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down Expand Up @@ -83,8 +81,6 @@ Object {
},
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down Expand Up @@ -158,8 +154,6 @@ Object {
},
Object {
"computed": true,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down Expand Up @@ -233,8 +227,6 @@ Object {
},
Object {
"computed": true,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down
Expand Up @@ -20,7 +20,6 @@ Object {
"params": Array [
Object {
"accessibility": "public",
"export": undefined,
"loc": Object {
"end": Object {
"column": 17,
Expand Down Expand Up @@ -60,7 +59,6 @@ Object {
},
Object {
"accessibility": "private",
"export": undefined,
"loc": Object {
"end": Object {
"column": 28,
Expand Down
Expand Up @@ -8,8 +8,6 @@ Object {
"body": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down Expand Up @@ -50,8 +48,6 @@ Object {
},
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down
Expand Up @@ -8,8 +8,6 @@ Object {
"body": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down
Expand Up @@ -53,8 +53,6 @@ Object {
"members": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down
Expand Up @@ -51,8 +51,6 @@ Object {
"members": Array [
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down Expand Up @@ -126,8 +124,6 @@ Object {
},
Object {
"computed": false,
"export": undefined,
"initializer": undefined,
"key": Object {
"loc": Object {
"end": Object {
Expand Down