Coder Social home page Coder Social logo

babel-plugin-syntax-pipeline's Introduction

babel-plugin-syntax-pipeline

Build Test Coverage Code Climate

Allow parsing of pipeline operator |>

Proposal: mindeavor/es-pipeline-operator


Installation

npm install --save-dev babel-plugin-syntax-pipeline

# or

yarn add --dev babel-plugin-syntax-pipeline

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["syntax-pipeline"]
}

Via CLI

babel --plugins syntax-pipeline script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["syntax-pipeline"]
});

Build

npm run build

Test

npm run test

Contributing

  1. Fork it (https://github.com/SuperPaintman/babel-plugin-syntax-pipeline/fork)
  2. Create your feature branch (git checkout -b feature/<feature_name>)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin feature/<feature_name>)
  5. Create a new Pull Request

Contributors


License

MIT

babel-plugin-syntax-pipeline's People

Contributors

superpaintman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

w2fs forek

babel-plugin-syntax-pipeline's Issues

SyntaxError: unknown: Unexpected token

I have tried lots of things, and I don't understand why it doesn't work for me.

Here is the snippet I'm using. Is the same example from the test directory:

const path = require('path')

require('babel-core').transform(`
      const res = user.name
        |> capitalize
        |> sayHello;
    `, {
  plugins: ['syntax-pipeline']
});

When I execute it I get this error:

/home/daniel/newTest/node_modules/babel-core/lib/transformation/file/index.js:590
      throw err;
      ^

SyntaxError: unknown: Unexpected token (3:9)
  1 | 
  2 |       const res = user.name
> 3 |         |> capitalize
    |          ^
  4 |         |> sayHello;
  5 |     
    at Parser.pp$5.raise (/home/daniel/newTest/node_modules/babylon/lib/index.js:4454:13)
    at Parser.pp.unexpected (/home/daniel/newTest/node_modules/babylon/lib/index.js:1761:8)
    at Parser.pp$3.parseExprAtom (/home/daniel/newTest/node_modules/babylon/lib/index.js:3750:12)
    at Parser.pp$3.parseExprSubscripts (/home/daniel/newTest/node_modules/babylon/lib/index.js:3494:19)
    at Parser.pp$3.parseMaybeUnary (/home/daniel/newTest/node_modules/babylon/lib/index.js:3474:19)
    at Parser.pp$3.parseExprOp (/home/daniel/newTest/node_modules/babylon/lib/index.js:3435:42)
    at Parser.pp$3.parseExprOps (/home/daniel/newTest/node_modules/babylon/lib/index.js:3408:17)
    at Parser.pp$3.parseMaybeConditional (/home/daniel/newTest/node_modules/babylon/lib/index.js:3381:19)
    at Parser.pp$3.parseMaybeAssign (/home/daniel/newTest/node_modules/babylon/lib/index.js:3344:19)
    at Parser.pp$1.parseVar (/home/daniel/newTest/node_modules/babylon/lib/index.js:2340:24)

Versions:

node: v8.2.1
babel-core: ^6.25.0
babel-plugin-syntax-pipeline: ^0.1.0

I have no idea why this isn't working, I have cloned this repo and the tests are working fine...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.