【问题标题】:Transformation error ... parser plugin(s): 'decorators-legacy, decorators'转换错误...解析器插件:'decorators-legacy,decorators'
【发布时间】:2020-01-20 21:51:02
【问题描述】:

运行jscodeshift -t ./react-codemod/transforms/React-PropTypes-to-prop-types.js ./src时出现以下错误

Transformation error (This experimental syntax requires enabling one of the following parser plugin(s): 'decorators-legacy, decorators' (13:0))

我搜索了一下,发现我必须设置 jscodeshift 的 --parser-config。我需要一个可以解决上述错误的示例 json 文件的帮助。

【问题讨论】:

标签: jscodeshift


【解决方案1】:

The Third 评论中提到的说明是正确的。
我需要用这个'decorators-legacy' 插件手动更新babel5Compat.js 文件。

// in ./node_modules/jscodeshift/parser/babel5Compat.js

plugins: [
    // a list of plugins,
    'decorators-legacy',
]

【讨论】:

    猜你喜欢
    • 2019-08-19
    • 2020-01-07
    • 1970-01-01
    • 1970-01-01
    • 2011-04-17
    • 2019-02-15
    • 1970-01-01
    • 2020-11-30
    • 2017-01-09
    相关资源
    最近更新 更多