All Projects → hugomrdias → Prettier Stylelint

hugomrdias / Prettier Stylelint

Licence: mit
code > prettier > stylelint > formatted code

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Prettier Stylelint

dva-typescript-antd-starter-kit
A admin dashboard application demo based on antd by typescript and dva
Stars: ✭ 61 (-62.35%)
Mutual labels:  stylelint, prettier
Prettier Eslint Cli
CLI for prettier-eslint
Stars: ✭ 451 (+178.4%)
Mutual labels:  prettier, cli
react-component-library-lerna
Build your own React component library managed with lerna, presented with storybook and published in private npm registry.
Stars: ✭ 55 (-66.05%)
Mutual labels:  stylelint, prettier
linter-sniffer-pretty-printer
Collection of packages and configs to lint and format code in your WordPress project.
Stars: ✭ 35 (-78.4%)
Mutual labels:  stylelint, prettier
React Ssr Starter
All have been introduced React environment
Stars: ✭ 20 (-87.65%)
Mutual labels:  prettier, stylelint
figma-plugin-typescript-boilerplate
Figma plugin TypeScript boilerplate to start developing right away
Stars: ✭ 43 (-73.46%)
Mutual labels:  stylelint, prettier
React 2048 Game
🎮 A fancy 2048 game build with react, redux best practices.
Stars: ✭ 401 (+147.53%)
Mutual labels:  prettier, stylelint
promotion-web
基于React: v18.x.x/Webpack: v5.x.x/React Router v6.x.x/ Antd: v5..x.x/Fetch Api/ Typescript: v4.x.x 等最新版本进行构建...
Stars: ✭ 374 (+130.86%)
Mutual labels:  stylelint, prettier
React Mobx React Router Boilerplate
A simple boilerplate based on create-react-app and add mobx, react-router, linter, prettier and so on. 一个简单的 react 脚手架依赖于 create-react-app 新增了 mobx react-router,linter,prettier 等。
Stars: ✭ 12 (-92.59%)
Mutual labels:  prettier, stylelint
Git Praise
A nicer git blame.
Stars: ✭ 24 (-85.19%)
Mutual labels:  prettier, cli
vue3-vite-ts
Vue 3 Scaffolding (Vite + TS + Linters + Jest + TailwindCSS)
Stars: ✭ 27 (-83.33%)
Mutual labels:  stylelint, prettier
Pretty Quick
⚡ Get Pretty Quick
Stars: ✭ 1,766 (+990.12%)
Mutual labels:  prettier, cli
fe-standard-config-seed
前端通用代码规范自动化接入
Stars: ✭ 18 (-88.89%)
Mutual labels:  stylelint, prettier
ember-boilerplate
👓 The stable base upon which we build our Ember.js projects at Mirego.
Stars: ✭ 33 (-79.63%)
Mutual labels:  stylelint, prettier
website-template
静的Webサイト制作を少しモダンにするためのテンプレート
Stars: ✭ 62 (-61.73%)
Mutual labels:  stylelint, prettier
Web Configs
Common configurations for building web apps at Shopify
Stars: ✭ 302 (+86.42%)
Mutual labels:  prettier, stylelint
eslint-config-ns
ESLint config ready to be used in multiple projects. Based on Airbnb's code style with prettier, jest and react support.
Stars: ✭ 27 (-83.33%)
Mutual labels:  stylelint, prettier
ultimate-hot-boilerplate
🚀 node-react universal app boilerplate with everything on hot reload, SSR, GraphQL, Flow included
Stars: ✭ 35 (-78.4%)
Mutual labels:  stylelint, prettier
Mevn Cli
Light speed setup for MEVN(Mongo Express Vue Node) Apps
Stars: ✭ 696 (+329.63%)
Mutual labels:  prettier, cli
Prettier Package Json
Prettier formatter for package.json files
Stars: ✭ 86 (-46.91%)
Mutual labels:  prettier, cli

prettier-stylelint NPM Version NPM Downloads NPM License Build Status codecov

Format your styles with ease!

code > prettier > stylelint > formatted code

prettier-stylelint attempts to create a prettier config based on the stylelint config, then format with prettier followed by stylelint --fix. So after that you should end up with formatted code with no linting errors.

Install

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

Usage

This package has a stylelint config to disable some rules that conflict with prettier.

"stylelint": {
    "extends": [
        "stylelint-config-idiomatic-order",
        "./node_modules/prettier-stylelint/config.js"
    ],
    "rules": {
        "indentation": 4,
        "string-quotes": "single"
    }
}

After adding the disabling config you can just prettier-stylelint --write and its done. Check the CLI options below for more information.
Also in a near future we should have support for prettier-stylelint in prettier-vscode follow this PR.

API

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 stderr

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

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

Related

License

MIT © Hugo Dias

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].