babel-plugin

Babel plugin error: Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`

∥☆過路亽.° 提交于 2021-01-29 20:06:10
问题 EDIT / UPDATE: I have taken loganfsmyth's advice and pulled out babel as the first argument to the sveltify function and I can access / console log babel.template.statement.ast however, if I try to call that function my app hangs indefinitely. Thie details: I am trying to use this with svelte to replace the import statement and I have a plugin as: const sveltify = (babel) => ({ visitor: { ImportDeclaration(path){ // import x from 'svelte/somewhere' if (path.node.source.value.startsWith(

VS Code error messages and Babel plugins

最后都变了- 提交于 2020-01-24 12:02:22
问题 How can I use this plugin https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-pipeline-operator And stop VS Code from bugging me about the |> operator without completely turning off error checks? Any suggestions appreciated! 回答1: VSCode's default JSlinter should be disabled. /.vscode/settings.json: { "javascript.validate.enable": false } This is my project settings: /.vscode/settings.json: Same above /package.json: "devDependencies": { "@babel/core": "^7.0.0-beta.42", "