Skip to content

ismail-syed/prettier-stylelint-formatter

Repository files navigation

prettier-stylelint NPM Version NPM Downloads NPM License

Format your styles with ease

code > prettier > stylelint > formatted code
prettier-eslint for stylelint :)
THIS IS STILL BETA DON'T USE THIS IN ANY IMPORTANT CODE
IF YOU DO GIT COMMIT FIRST ^^

Install

yarn add prettier-stylelint -D
npm install prettier-stylelint --save-dev

Usage

const format = require('prettier-eslint')
const sourceCode = 'a[id="foo"] { content: "x"; }'
const options = {
  text: sourceCode
}
const formatted = format(options)


// formatted 
a[id='foo'] {
    content: 'x';
}

CLI Options

The cli automatically ignores .gitignore and .prettierignore.

NOTE: It is recommended that you keep your files under source control and committed before running prettier-stylelint --write as it will overwrite your files!

Usage
  $ prettier-stylelint [<file|glob> ...]

Options
  --ignore          Additional paths to ignore  [Can be set multiple times]
  --extension       Additional extension to lint [Can be set multiple times]
  --cwd=<dir>       Working directory for files
  --stdin           Validate/fix code from stdin ('prettier-stylelint -' also works)
  --write           Edit files in place (DRAGONS AHEAD !!)
  --quiet -q        Only log std.err

Examples
  $ prettier-stylelint
  $ prettier-stylelint index.js
  $ prettier-stylelint *.js !foo.js
  $ echo 'a[id="foo"] { content: "x"; }' | prettier-stylelint --stdin
  $ echo 'a[id="foo"] { content: "x"; }' | prettier-stylelint -

Default pattern when no arguments:
  **/*.{css,scss,less,sss}

Related

License

MIT © Hugo Dias

About

Fork of hugomrdias/prettier-stylelint

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 79.3%
  • CSS 20.7%