feat: add emitDecoratorMetadata config #1420
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #1173
用例来自 https://github.com/leonardfactory/babel-plugin-transform-typescript-metadata/blob/master/test/__fixtures__/generics/code.js
参考:
https://www.typescriptlang.org/docs/handbook/decorators.html#metadata
https://github.com/leonardfactory/babel-plugin-transform-typescript-metadata
https://babeljs.io/docs/babel-plugin-transform-typescript#typescript-compiler-options
Summary by CodeRabbit
新功能
emitDecoratorMetadata
配置选项并默认设置为true
,优化了装饰器的元数据发射功能。emitDecoratorMetadata
功能。文档
config.md
文档,修改了emitDecoratorMetadata
和useDefineForClassFields
选项的默认值说明。测试