New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot extend pipeline operator #6176
Comments
Hey @willin! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
We don't support custom syntaxes in babylon. You'll need to fork it and add support yourself, or wait till the pipeline operator has been officially accepted as a stage 0 proposal. |
how to???? there is no doc |
Until the proposed pipeline syntax is accepted Stage 0 proposal, we will not implement support for it. The |
how to implement by myself for private study? |
.babelrc: {
"parserOpts": {
"parser": "transform-pipeline-operator"
}
} still no use
|
You have to fork the babylon parser, implement the features in your fork, then use that fork in your |
it works now. {
"parserOpts": {
"parser": "@airdwing/babylon"
},
"plugins": [
"transform-pipeline-operator"
]
} here's my eslint config module.exports = {
root: true,
extends: 'dwing',
parser: 'babel-eslint'
};
how to fix this? |
I think you also have to fork babel-eslint an replace Babylon there |
@willin Keep in mind, the point of this feature is to allow people to experiment with new features, not to officially support them. As stated, we don't officially aim to support extra syntax until it's accepted as a proposal. |
babel-plugin-proposal-pipeline-operator will support const hello = function ( name ) {
return new Promise(( resolve, reject ) => {
setTimeout(() => {
console.log( `hello, ${ name }` );
resolve( name );
}, 1000);
});
}
const world = function ( name ) {
console.log( `world, ${ name }` );
}
const foo = async () => {
'foo' |> hello |> await |> world;
};
foo(); |
@lilijialiang Babel follows the spec/proposal, it isn't part of the spec atm. We can open an issue there if you want. |
@xtuc I see. but I think if it can support |
ah sorry, I was wrong. it is actually part of the spec. I created #6889 to keeping track of that. |
Choose one: is this a bug report or feature request?
Input Code
https://unpkg.com/babel-plugin-transform-pipeline-operator@1.0.2/lib/index.js
Babel Configuration (.babelrc, package.json, cli command)
Current Behavior
The text was updated successfully, but these errors were encountered: