A Code Climate engine that wraps stylelint.
You can run it on your local environment using the Code Climate CLI, or on the hosted analysis platform.
Stylelint is a tool to help you enforce consistent conventions and avoid errors in your stylesheets.
It can be configured using a configuration file.
- If you haven't already, install the Code Climate CLI.
- Run
codeclimate engines:enable stylelint
. This command both installs the engine and enables it in your.codeclimate.yml
file. - Add a stylelint config file.
- You're ready to analyze! Browse into your project's folder and run
codeclimate analyze
.
ignore_warnings
: true|false (default false) - skip warnings with styletintquiet
flagconfig
: Specify a relative path for the configuration file. (ex: config/.stylelintrc)
- stylelint-config-standard: The standard shareable config
- stylelint-config-wordpress: WordPress CSS Coding Standards shareable config
- stylelint-config-suitcss: SUIT CSS config
- stylelint-config-css-modules: CSS modules shareable config
This engine has support for the recommended plugins:
- stylelint-order: Order related linting rules.
- stylelint-scss: SCSS specific linting rules.
- stylelint-declaration-strict-value: Enforces variables, functions or custom CSS keywords for property's values.
- stylelint-declaration-use-variable: Specify properties for which a SCSS variable must be used.
- stylelint-selector-bem-pattern: Specify a BEM pattern for selectors.
- stylelint-rscss: Validate RSCSS conventions.
- stylelint-selector-no-utility: A collection of SCSS specific linting rules.
- stylelint-csstree-validator: Validate CSS values to match W3C specs and browsers extensions.
If you need something else, please open an issue.
This engine has support for some of the recommended processors:
- stylelint-processor-html: Lint within HTML
<style>
tags.
If you want to test the code for this engine locally, you'll need to install docker.
Build the docker image with docker docker build -t codeclimate/codeclimate-stylelint .
(You must be inside the project directory to do this)
run npm test
or ./run-tests.sh
only after building the image.
If you need something else, please open an issue.
For help with stylelint, check out their documentation.