styled-components-stylefmt
Formats styled-components templates with stylefmt
Last updated 2 years ago by enoah_netzach .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install styled-components-stylefmt 
SYNC missed versions from official npm registry.

Modern CSS Formatter for the component age

npm Build Status Coverage Status

+

styled-components

Installation

with yarn:

yarn add --dev styled-components-stylefmt

or with npm:

npm install --save-dev styled-components-stylefmt

Features

Example

import React from 'react';
import styled from 'styled-components';

const Title = styled.h1`
  font-size: 1.5em;
 text-align: center;
    color: palevioletred;
`;

const Wrapper = styled.section`
  padding   : 4em;
  background: papayawhip   ;
`;

yields:

import React from 'react';
import styled from 'styled-components';

const Title = styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;

const Wrapper = styled.section`
  padding: 4em;
  background: papayawhip;
`;

Usage

in command line

CLI help:

styled-components-stylefmt --help
Usage: styled-components-stylefmt [options] input-name [output-name]

Options:

  -b, --config-basedir   Path to the directory that relative paths defining \\"extends\\"
  -c, --config           Path to a specific configuration file (JSON, YAML, or CommonJS)
  -d, --diff             Output diff against original file
  -r, --recursive        Format list of space seperated files(globs) in place
  -v, --version          Output the version number
  -h, --help             Output usage information
  -i, --ignore-path      Path to a file containing patterns that describe files to ignore.

in Node.js

const formatter = require('styled-components-stylefmt')

const stylefmtOptions = {
  // ...
}

const formatted = formatter('input.js', stylefmtOptions)

stylelint rules it can handle

All the rules that stylefmt can.

Current Tags

  • 0.1.5                                ...           latest (2 years ago)

7 Versions

  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 24
Dependencies (13)
Dev Dependencies (18)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |