[babel 8] fix properties name for function-like TS nodes#13709
[babel 8] fix properties name for function-like TS nodes#13709nicolo-ribaudo merged 6 commits intobabel:mainfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0851d5d:
|
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/50646/ |
| if (!returnType) { | ||
| console.log(node); | ||
| } |
There was a problem hiding this comment.
| if (!returnType) { | |
| console.log(node); | |
| } |
| typeParameters: validateOptionalType("TSTypeParameterDeclaration"), | ||
| parameters: validateArrayOfType(["Identifier", "RestElement"]), | ||
| typeAnnotation: validateOptionalType("TSTypeAnnotation"), | ||
| [process.env.BABEL_8_BREAKING ? "params" : "parameters"]: validateArrayOfType( |
There was a problem hiding this comment.
Q: don't we use BABEL_TYPES_8_BREAKING in babel-types?
/cc @JLHwung @nicolo-ribaudo
There was a problem hiding this comment.
Oh I didn't know BABEL_TYPES_8_BREAKING environment variables.
There was a problem hiding this comment.
I prefer BABEL_8_BREAKING here. BABEL_TYPES_8_BREAKING can be used by @babel/types consumers to opt-in into stricter validation that we will have in Babel 8. However, opting-in into this AST change makes it impossible to use @babel/types with @babel/parser and @babel/generator.
502de98 to
28c502a
Compare
0851d5d to
524e34d
Compare
|
@JLHwung Could you review this? |
This PR contains many test changes. It is recommended that you review each commit.
Change
parametersandtypeAnnotationtoparamsandreturnTypein the following 5 function-like nodesTSCallSignatureDeclarationTSMethodSignatureTSConstructSignatureDeclarationTSFunctionTypeTSConstructorTypeCode examples: