UNPKG

@justia/stylelint-config

Version:
63 lines (41 loc) 1.88 kB
<!-- UPDATE-PACKAGES:START - Do not remove or modify this section --> # `@justia/stylelint-config` ![version 5.0.2](https://img.shields.io/badge/version-5.0.2-blue?style=flat-square) <!-- omit from toc --> > Justia's base Scss Stylelint configuration <!-- UPDATE-PACKAGES:END --> This [stylelint configuration](https://stylelint.io/user-guide/configure) uses the basic declaration order of [Idiomatic CSS](https://github.com/necolas/idiomatic-css#declaration-order), applies the [Sass Guidelines](https://sass-guidelin.es/) to a more consistent Scss and uses [prettier](https://github.com/prettier/stylelint-prettier) to format the code. > Make sure you upgrade to at least Node.js `12.22.0` when using this packages because of prettier and other plugins used internally. ## Install Install the correct versions of the peer dependencies, which are listed by the command: ```shell npm info "@justia/stylelint-config@latest" peerDependencies ``` If using **npm 5+**, use this shortcut ```shell npx install-peerdeps --dev @justia/stylelint-config ``` If using npm < 5, Linux/OSX users can run ```shell ( export PKG=@justia/stylelint-config; npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest" ) ``` Which produces and runs a command like: ```shell npm install --save-dev @justia/stylelint-config stylelint@^#.#.# prettier@^#.#.# ``` ## Usage Set your stylelint configuration to: ```json { "extends": ["@justia/stylelint-config"] } ``` You can easily [extend](https://github.com/stylelint/stylelint/blob/13.7.2/docs/user-guide/configure.md#extends) the config to your needs. ### `@justia/stylelint-config/rscss` This entry point enables the validation of the code against [RSCSS](https://rscss.io/) conventions. ```json { "extends": ["@justia/stylelint-config/rscss"] } ```