Syntax Error: Unexpected token |> (partially solved 😅) #1
Labels
Comments
Hi, @alvaropinot ! In fact, this plugin babel-plugin-syntax-pipeline is a monkey patch (aka decorator). Maybe something has changed in the babylon API |
Oh! So that may be the issue :) thanks for the quick response Well maybe this thread can help someone with the setup. |
I'll try to update the Babilon in tests later. |
Let me know if I can help you about something :) |
how to run a basic demo? here's my project: https://github.com/willin/esnext-pipeline-biolerplate .babelrc {
"presets": [
"env"
],
"plugins": [
"transform-pipeline"
]
} src/index.js function doubleSay(str) {
return `${str}, ${str}`;
}
function capitalize(str) {
return str[0].toUpperCase() + str.substring(1);
}
function exclaim(str) {
return `${str}!`;
}
let result = "hello"
|> doubleSay
|> capitalize
|> exclaim;
result
|> console.log;
//=> "Hello, hello!" package.json {
"name": "esnext-pipeline-biolerplate",
"version": "1.0.0",
"main": "src/index.js",
"scripts": {
"start": "babel-node ."
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-env": "^2.4.1",
"babel-eslint": "^7.2.3",
"babel-plugin-transform-pipeline": "^0.1.0",
"eslint": "^4.5.0",
"eslint-config-dwing": "^1.1.0"
}
} .eslintrc.js (optional) module.exports = {
root: true,
extends: 'dwing',
parser: 'babel-eslint'
}; |
p.s. let result = "hello" |> doubleSay |> capitalize |> exclaim; is inline ok? |
package-lock.json tried no use,
|
+1 |
+1 PS: This library is amazing |
+1 |
1 similar comment
+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I'm having issues with babel transforming the
|>
. After checking your repo and comparing the generatedpackage-lock.json
for my demo and your tests, found that some of the dependencies versions were causing the issue. Seems like is related withbabylon
6.17.4
but it's working fine with6.13.0
. But the issue could deeper inside some of the extra sub dependencies. Any extra info will be welcomed :)Just in case it may help anyone trying out the plugin, this is the setup that's working for me:
package.json
And this is the
package-lock.json
with all the resolved dependencies working:package-lock.json (click to expand)
package-lock.json
The text was updated successfully, but these errors were encountered: