当我运行时出现以下错误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))
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索了一下,发现我必须设置--parser-config
jscodeshift。我需要有关可以解决上述错误的示例 json 文件的帮助。
第三者评论中提到的说明是正确的。
我需要babel5Compat.js
使用此插件手动更新文件'decorators-legacy'
。
// in ./node_modules/jscodeshift/parser/babel5Compat.js
plugins: [
// a list of plugins,
'decorators-legacy',
]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9218 次 |
最近记录: |