ReadMe coding standards for all things style-related, specifically CSS and SCSS.
# Install the config as a dev dependency.
npm install --save-dev @readme/eslint-config
You need to additionally install Stylelint and PostCSS into your project. These are peer dependencies of @readme/stylelint-config
, which can conveniently be installed either manually or using install-peerdeps
.
# Install with "install-peerdeps"
npx install-peerdeps --dev @readme/stylelint-config
# Install manually
npm install --save-dev stylelint postcss
Create a stylelint.config.js
file with the following contents:
module.exports = {
extends: '@readme/stylelint-config',
};
# Run unit tests
npm run test
# Run unit tests in watch mode
npm run test -- --watch
We've adopted the following list of shared configs that remain actively maintained by the broader developer community.
- stylelint-config-standard - The standard shareable config for Stylelint.
- stylelint-config-standard-scss - The standard shareable SCSS config for Stylelint.
- stylelint-config-sass-guidelines - A stylelint config inspired by sass-guidelin.es.
- stylelint-config-css-modules - CSS modules shareable config for stylelint. Tweaks stylelint rules to accept css modules specific syntax.
- stylelint-prettier/recommended - Runs Prettier as a Stylelint rule and reports differences as individual Stylelint issues.