@observablehq/prettier-react-tachyons
![Node CI](https://github.com/observablehq/prettier-react-tachyons/workflows/Node%20CI/badge.svg)
Last updated 8 months ago by jashkenas .
MIT · Original npm · Tarball · package.json
$ cnpm install @observablehq/prettier-react-tachyons 
SYNC missed versions from official npm registry.

@observablehq/prettier-react-tachyons

Node CI

A prettier custom parser plugin for users of React and tachyons. It adds an extra prettier transform for className= attributes on JSX elements, that takes care of the following:

  • Eliminating redundant classes
  • Sorting classes in a predictable order

How do you use it?

This is admittedly a little bleeding-edge: prettier supports custom parsers, but not custom rules / reformatters, so this essentially augments prettier's babylon-based parser for JavaScript. You can configure prettier to point to it with the parser option. For instance, here's how we configure prettier in our .prettierrc:

{
  "parser": "./node_modules/@observablehq/prettier-react-tachyons"
}

Example:

in:

<div className='h1 h1 w2 pv2 bg-transparent red' />

out:

<div className='w2 h1 pv2 red bg-transparent' />

Current Tags

  • 1.2.0                                ...           latest (8 months ago)

4 Versions

  • 1.2.0                                ...           8 months ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 9
Dependencies (1)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |