Giter VIP home page Giter VIP logo

depercolator's Introduction

Depercolator CircleCI

This tool is a swiss army knife for converting coffeescript files to javascript. It relies on several other tools to ease the conversion process and create idiomatic javascript and JSX.

Learn more from our blog on converting our React codebase from CoffeeScript to ES6.

Installation

npm i -g depercolator

or

yarn global add depercolator

Usage

depercolate <file> [options]

Options

  • -o, --output [filepath]: Change path of resulting file (defaults to same path as original with a different extension)
  • --skip-prettier: Do not reformat the file with prettier (default is false)

Decaffeinate options

Most options from decaffeinate can be passed through to the underlying command

  • --keep-commonjs: Do not convert require and module.exports to import and export
  • --prefer-const: Use const when possible in output code
  • --loose-default-params: Convert CS default params to JS default params.
  • --loose-for-expressions: Do not wrap expression loop targets in Array.from
  • --loose-for-of: Do not wrap JS for...of loop targets in Array.from
  • --loose-includes: Do not wrap in Array.from when converting in to includes
  • --allow-invalid-constructors: Don't error when constructors use this before super or omit the super call in a subclass.
  • --enable-babel-constructor-workaround: Use a hacky babel-specific workaround to allow this before super in constructors.

Prettier options

Most options from prettier can be passed through to the underlying command

  • --print-width <int>: Specify the length of line that the formatter will wrap on. Defaults to 80.
  • --tab-width <int>: Specify the number of spaces per indentation-level. Defaults to 2.
  • --use-tabs: Indent lines with tabs instead of spaces. Defaults to false.
  • --single-quote: Use single quotes instead of double.
  • --trailing-comma: Print trailing commas wherever possible.
  • --bracket-spacing: Put spaces between brackets. Defaults to true.
  • --jsx-bracket-same-line: Put > on the last line. Defaults to false.
  • --parser <flow|babylon>: Specify which parse to use. Defaults to babylon.

depercolator's People

Contributors

foxyblocks avatar kpinedok avatar pruett avatar xhmikosr avatar

Stargazers

Chris Styles avatar

Watchers

Ian Bartholomew avatar

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.