Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: rename typeParameters to typeArguments where needed#5384

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
1a705ee
fix!: rename typeParameters to typeArguments where needed
JoshuaKGoldbergJul 26, 2022
72a7436
Fix type-utils > isUnsafeAssignment
JoshuaKGoldbergJul 26, 2022
6573aa0
Merge branch 'main'
JoshuaKGoldbergFeb 5, 2023
52f7c96
Ignore the tets, why not
JoshuaKGoldbergFeb 5, 2023
32a4c4d
Merge branch 'v6' (note: tests failing)
JoshuaKGoldbergFeb 7, 2023
c29fb7a
Corrected visitor-keys
JoshuaKGoldbergFeb 7, 2023
bd4b69a
Got implements, extends, and instantiation expressions
JoshuaKGoldbergFeb 7, 2023
80d5cd1
Merge branch 'v6'
JoshuaKGoldbergFeb 10, 2023
f3e7d8e
chore: check package.json existence in package-packages.ts
JoshuaKGoldbergFeb 11, 2023
745a6b3
Merge branch 'pack-packages-check-package-json' into correct-type-par…
JoshuaKGoldbergFeb 11, 2023
30f4721
Merge branch 'v6'
JoshuaKGoldbergFeb 15, 2023
0c5ef4a
Merge branch 'v6'
JoshuaKGoldbergFeb 15, 2023
b9529cc
Rename superTypeArguments/Parameters too
JoshuaKGoldbergFeb 21, 2023
4677c8e
Merge branch 'v6'
JoshuaKGoldbergFeb 21, 2023
64c24c2
Correct superTypeParameter/Argument(s)
JoshuaKGoldbergFeb 21, 2023
4635a97
Merge branch 'v6' into correct-type-parameters-to-arguments
JoshuaKGoldbergFeb 22, 2023
627a883
Added deprecated properties too
JoshuaKGoldbergFeb 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletionspackages/ast-spec/src/base/ClassBase.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,11 @@ export interface ClassBase extends BaseNode {
* The generic type parameters passed to the superClass.
* This is `undefined` if there are no generic type parameters passed.
*/
superTypeArguments?: TSTypeParameterInstantiation;

/** @deprecated Use {@link `superTypeArguments`} instead. */
superTypeParameters?: TSTypeParameterInstantiation;

/**
* The generic type parameters declared for the class.
* This is `undefined` if there are no generic type parameters declared.
Expand Down
3 changes: 3 additions & 0 deletionspackages/ast-spec/src/base/TSHeritageBase.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,5 +5,8 @@ import type { BaseNode } from './BaseNode';
export interface TSHeritageBase extends BaseNode {
// TODO(#1852) - this should be restricted to MemberExpression | Identifier
expression: Expression;
typeArguments?: TSTypeParameterInstantiation;

/** @deprecated Use {@link `typeArguments`} instead. */
typeParameters?: TSTypeParameterInstantiation;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,6 +36,26 @@ Program {
end: { column: 21, line: 1 },
},
},
superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
type: "TSStringKeyword",

range: [22, 28],
loc: {
start: { column: 22, line: 1 },
end: { column: 28, line: 1 },
},
},
],

range: [21, 29],
loc: {
start: { column: 21, line: 1 },
end: { column: 29, line: 1 },
},
},
superTypeParameters: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,98 @@

exports[`AST Fixtures declaration ClassDeclaration extends-type-param AST Alignment - AST 1`] = `
"Snapshot Diff:
Compared values have no visual difference."
- TSESTree
+ Babel

Program {
type: 'Program',
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
body: ClassBody {
type: 'ClassBody',
body: Array [],

range: [30, 32],
loc: {
start: { column: 30, line: 1 },
end: { column: 32, line: 1 },
},
},
id: Identifier {
type: 'Identifier',
name: 'Foo',

range: [6, 9],
loc: {
start: { column: 6, line: 1 },
end: { column: 9, line: 1 },
},
},
superClass: Identifier {
type: 'Identifier',
name: 'Set',

range: [18, 21],
loc: {
start: { column: 18, line: 1 },
end: { column: 21, line: 1 },
},
},
- superTypeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSStringKeyword {
- type: 'TSStringKeyword',
-
- range: [22, 28],
- loc: {
- start: { column: 22, line: 1 },
- end: { column: 28, line: 1 },
- },
- },
- ],
-
- range: [21, 29],
- loc: {
- start: { column: 21, line: 1 },
- end: { column: 29, line: 1 },
- },
- },
superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
type: 'TSStringKeyword',

range: [22, 28],
loc: {
start: { column: 22, line: 1 },
end: { column: 28, line: 1 },
},
},
],

range: [21, 29],
loc: {
start: { column: 21, line: 1 },
end: { column: 29, line: 1 },
},
},

range: [0, 32],
loc: {
start: { column: 0, line: 1 },
end: { column: 32, line: 1 },
},
},
],
sourceType: 'script',

range: [0, 33],
loc: {
start: { column: 0, line: 1 },
end: { column: 0, line: 2 },
},
}"
`;
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,6 +36,36 @@ Program {
end: { column: 24, line: 1 },
},
},
superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "T",

range: [25, 26],
loc: {
start: { column: 25, line: 1 },
end: { column: 26, line: 1 },
},
},

range: [25, 26],
loc: {
start: { column: 25, line: 1 },
end: { column: 26, line: 1 },
},
},
],

range: [24, 27],
loc: {
start: { column: 24, line: 1 },
end: { column: 27, line: 1 },
},
},
superTypeParameters: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,36 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-
end: { column: 24, line: 1 },
},
},
- superTypeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSTypeReference {
- type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'T',
-
- range: [25, 26],
- loc: {
- start: { column: 25, line: 1 },
- end: { column: 26, line: 1 },
- },
- },
-
- range: [25, 26],
- loc: {
- start: { column: 25, line: 1 },
- end: { column: 26, line: 1 },
- },
- },
- ],
-
- range: [24, 27],
- loc: {
- start: { column: 24, line: 1 },
- end: { column: 27, line: 1 },
- },
- },
superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
Expand Down
4 changes: 4 additions & 0 deletionspackages/ast-spec/src/expression/CallExpression/spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,10 @@ export interface CallExpression extends BaseNode {
type: AST_NODE_TYPES.CallExpression;
callee: LeftHandSideExpression;
arguments: CallExpressionArgument[];
typeArguments?: TSTypeParameterInstantiation;

/** @deprecated Use {@link `typeArguments`} instead. */
typeParameters?: TSTypeParameterInstantiation;

optional: boolean;
}
3 changes: 3 additions & 0 deletionspackages/ast-spec/src/expression/NewExpression/spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,5 +8,8 @@ export interface NewExpression extends BaseNode {
type: AST_NODE_TYPES.NewExpression;
callee: LeftHandSideExpression;
arguments: CallExpressionArgument[];
typeArguments?: TSTypeParameterInstantiation;

/** @deprecated Use {@link `typeArguments`} instead. */
typeParameters?: TSTypeParameterInstantiation;
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,8 @@ import type { Expression } from '../../unions/Expression';
export interface TSInstantiationExpression extends BaseNode {
type: AST_NODE_TYPES.TSInstantiationExpression;
expression: Expression;
typeParameters: TSTypeParameterInstantiation;
typeArguments: TSTypeParameterInstantiation;

/** @deprecated Use {@link `typeArguments`} instead. */
typeParameters?: TSTypeParameterInstantiation;
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import type { TemplateLiteral } from '../TemplateLiteral/spec';

export interface TaggedTemplateExpression extends BaseNode {
type: AST_NODE_TYPES.TaggedTemplateExpression;
typeArguments?: TSTypeParameterInstantiation;

/** @deprecated Use {@link `typeArguments`} instead. */
typeParameters?: TSTypeParameterInstantiation;

tag: LeftHandSideExpression;
quasi: TemplateLiteral;
}
4 changes: 4 additions & 0 deletionspackages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,11 @@ import type { JSXSpreadAttribute } from '../JSXSpreadAttribute/spec';

export interface JSXOpeningElement extends BaseNode {
type: AST_NODE_TYPES.JSXOpeningElement;
typeArguments?: TSTypeParameterInstantiation;

/** @deprecated Use {@link `typeArguments`} instead. */
typeParameters?: TSTypeParameterInstantiation;

selfClosing: boolean;
name: JSXTagNameExpression;
attributes: (JSXAttribute | JSXSpreadAttribute)[];
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,6 +41,26 @@ Program {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
type: "TSStringKeyword",

range: [147, 153],
loc: {
start: { column: 35, line: 4 },
end: { column: 41, line: 4 },
},
},
],

range: [146, 154],
loc: {
start: { column: 34, line: 4 },
end: { column: 42, line: 4 },
},
},
typeName: Identifier {
type: "Identifier",
name: "Promise",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,6 +50,26 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSStringKeyword {
- type: 'TSStringKeyword',
-
- range: [147, 153],
- loc: {
- start: { column: 35, line: 4 },
- end: { column: 41, line: 4 },
- },
- },
- ],
-
- range: [146, 154],
- loc: {
- start: { column: 34, line: 4 },
- end: { column: 42, line: 4 },
- },
- },
typeName: Identifier {
type: 'Identifier',
name: 'Promise',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,26 @@ Program {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
type: "TSStringKeyword",

range: [139, 145],
loc: {
start: { column: 27, line: 4 },
end: { column: 33, line: 4 },
},
},
],

range: [138, 146],
loc: {
start: { column: 26, line: 4 },
end: { column: 34, line: 4 },
},
},
typeName: Identifier {
type: "Identifier",
name: "Promise",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -48,6 +48,26 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSStringKeyword {
- type: 'TSStringKeyword',
-
- range: [139, 145],
- loc: {
- start: { column: 27, line: 4 },
- end: { column: 33, line: 4 },
- },
- },
- ],
-
- range: [138, 146],
- loc: {
- start: { column: 26, line: 4 },
- end: { column: 34, line: 4 },
- },
- },
typeName: Identifier {
type: 'Identifier',
name: 'Promise',
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp