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: rename typeParameters to typeArguments where needed #5384

Merged
Show file tree
Hide file tree
Changes from 12 commits
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: 1 addition & 1 deletion packages/ast-spec/src/base/TSHeritageBase.ts
Expand Up @@ -5,5 +5,5 @@ import type { BaseNode } from './BaseNode';
export interface TSHeritageBase extends BaseNode {
// TODO(#1852) - this should be restricted to MemberExpression | Identifier
expression: Expression;
typeParameters?: TSTypeParameterInstantiation;
typeArguments?: TSTypeParameterInstantiation;
}
2 changes: 1 addition & 1 deletion packages/ast-spec/src/expression/CallExpression/spec.ts
Expand Up @@ -8,6 +8,6 @@ export interface CallExpression extends BaseNode {
type: AST_NODE_TYPES.CallExpression;
callee: LeftHandSideExpression;
arguments: CallExpressionArgument[];
typeParameters?: TSTypeParameterInstantiation;
typeArguments?: TSTypeParameterInstantiation;
optional: boolean;
}
2 changes: 1 addition & 1 deletion packages/ast-spec/src/expression/NewExpression/spec.ts
Expand Up @@ -8,5 +8,5 @@ export interface NewExpression extends BaseNode {
type: AST_NODE_TYPES.NewExpression;
callee: LeftHandSideExpression;
arguments: CallExpressionArgument[];
typeParameters?: TSTypeParameterInstantiation;
typeArguments?: TSTypeParameterInstantiation;
}
Expand Up @@ -6,5 +6,5 @@ import type { Expression } from '../../unions/Expression';
export interface TSInstantiationExpression extends BaseNode {
type: AST_NODE_TYPES.TSInstantiationExpression;
expression: Expression;
typeParameters: TSTypeParameterInstantiation;
typeArguments: TSTypeParameterInstantiation;
}
Expand Up @@ -6,7 +6,7 @@ import type { TemplateLiteral } from '../TemplateLiteral/spec';

export interface TaggedTemplateExpression extends BaseNode {
type: AST_NODE_TYPES.TaggedTemplateExpression;
typeParameters?: TSTypeParameterInstantiation;
typeArguments?: TSTypeParameterInstantiation;
tag: LeftHandSideExpression;
quasi: TemplateLiteral;
}
2 changes: 1 addition & 1 deletion packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
Expand Up @@ -7,7 +7,7 @@ import type { JSXSpreadAttribute } from '../JSXSpreadAttribute/spec';

export interface JSXOpeningElement extends BaseNode {
type: AST_NODE_TYPES.JSXOpeningElement;
typeParameters?: TSTypeParameterInstantiation;
typeArguments?: TSTypeParameterInstantiation;
selfClosing: boolean;
name: JSXTagNameExpression;
attributes: (JSXAttribute | JSXSpreadAttribute)[];
Expand Down
Expand Up @@ -41,17 +41,7 @@ Program {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "Promise",

range: [139, 146],
loc: {
start: { column: 27, line: 4 },
end: { column: 34, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
Expand All @@ -71,6 +61,16 @@ Program {
end: { column: 42, line: 4 },
},
},
typeName: Identifier {
type: "Identifier",
name: "Promise",

range: [139, 146],
loc: {
start: { column: 27, line: 4 },
end: { column: 34, line: 4 },
},
},

range: [139, 154],
loc: {
Expand Down
Expand Up @@ -50,17 +50,18 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
name: 'Promise',

range: [139, 146],
loc: {
start: { column: 27, line: 4 },
end: { column: 34, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
- typeArguments: TSTypeParameterInstantiation {
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Promise',
+
+ range: [139, 146],
+ loc: {
+ start: { column: 27, line: 4 },
+ end: { column: 34, line: 4 },
+ },
+ },
+ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
Expand All @@ -78,6 +79,16 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
loc: {
start: { column: 34, line: 4 },
end: { column: 42, line: 4 },
- },
- },
- typeName: Identifier {
- type: 'Identifier',
- name: 'Promise',
-
- range: [139, 146],
- loc: {
- start: { column: 27, line: 4 },
- end: { column: 34, line: 4 },
},
},

Expand Down
Expand Up @@ -42,17 +42,7 @@ Program {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "Promise",

range: [131, 138],
loc: {
start: { column: 19, line: 4 },
end: { column: 26, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
Expand All @@ -72,6 +62,16 @@ Program {
end: { column: 34, line: 4 },
},
},
typeName: Identifier {
type: "Identifier",
name: "Promise",

range: [131, 138],
loc: {
start: { column: 19, line: 4 },
end: { column: 26, line: 4 },
},
},

range: [131, 146],
loc: {
Expand Down
Expand Up @@ -48,17 +48,18 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
name: 'Promise',

range: [131, 138],
loc: {
start: { column: 19, line: 4 },
end: { column: 26, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
- typeArguments: TSTypeParameterInstantiation {
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Promise',
+
+ range: [131, 138],
+ loc: {
+ start: { column: 19, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
Expand All @@ -76,6 +77,16 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
loc: {
start: { column: 26, line: 4 },
end: { column: 34, line: 4 },
- },
- },
- typeName: Identifier {
- type: 'Identifier',
- name: 'Promise',
-
- range: [131, 138],
- loc: {
- start: { column: 19, line: 4 },
- end: { column: 26, line: 4 },
},
},

Expand Down
Expand Up @@ -39,7 +39,7 @@ Program {
end: { column: 24, line: 3 },
},
},
typeParameters: TSTypeParameterInstantiation {
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSTypeReference {
Expand Down
Expand Up @@ -45,7 +45,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi
end: { column: 24, line: 3 },
},
},
typeParameters: TSTypeParameterInstantiation {
- typeArguments: TSTypeParameterInstantiation {
+ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
Expand Down
Expand Up @@ -39,7 +39,7 @@ Program {
end: { column: 24, line: 3 },
},
},
typeParameters: TSTypeParameterInstantiation {
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSTypeReference {
Expand Down
Expand Up @@ -45,7 +45,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A
end: { column: 24, line: 3 },
},
},
typeParameters: TSTypeParameterInstantiation {
- typeArguments: TSTypeParameterInstantiation {
+ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
Expand Down
Expand Up @@ -76,17 +76,7 @@ Program {
type: "TSTypeParameter",
constraint: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "Constructor",

range: [94, 105],
loc: {
start: { column: 21, line: 3 },
end: { column: 32, line: 3 },
},
},
typeParameters: TSTypeParameterInstantiation {
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSTypeReference {
Expand Down Expand Up @@ -116,6 +106,16 @@ Program {
end: { column: 35, line: 3 },
},
},
typeName: Identifier {
type: "Identifier",
name: "Constructor",

range: [94, 105],
loc: {
start: { column: 21, line: 3 },
end: { column: 32, line: 3 },
},
},

range: [94, 108],
loc: {
Expand Down
Expand Up @@ -80,17 +80,18 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig
type: 'TSTypeParameter',
constraint: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
name: 'Constructor',

range: [94, 105],
loc: {
start: { column: 21, line: 3 },
end: { column: 32, line: 3 },
},
},
typeParameters: TSTypeParameterInstantiation {
- typeArguments: TSTypeParameterInstantiation {
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Constructor',
+
+ range: [94, 105],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
Expand Down Expand Up @@ -120,7 +121,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig
end: { column: 35, line: 3 },
},
},

- typeName: Identifier {
- type: 'Identifier',
- name: 'Constructor',

- range: [94, 105],
- loc: {
- start: { column: 21, line: 3 },
- end: { column: 32, line: 3 },
- },
- },
-
range: [94, 108],
loc: {
start: { column: 21, line: 3 },
Expand Down
Expand Up @@ -116,17 +116,7 @@ Program {
type: "TSTypeParameter",
constraint: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "Constructor",

range: [94, 105],
loc: {
start: { column: 21, line: 3 },
end: { column: 32, line: 3 },
},
},
typeParameters: TSTypeParameterInstantiation {
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSTypeLiteral {
Expand All @@ -147,6 +137,16 @@ Program {
end: { column: 36, line: 3 },
},
},
typeName: Identifier {
type: "Identifier",
name: "Constructor",

range: [94, 105],
loc: {
start: { column: 21, line: 3 },
end: { column: 32, line: 3 },
},
},

range: [94, 109],
loc: {
Expand Down Expand Up @@ -256,7 +256,7 @@ Program {
},
},
optional: false,
typeParameters: TSTypeParameterInstantiation {
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSAnyKeyword {
Expand Down