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-sass-guidelines: A stylelint config based on https://sass-guidelin.es/
- stylelint-config-suitcss: SUIT CSS config
- stylelint-config-css-modules: CSS modules shareable config
- stylelint-config-wordpress: WordPress CSS Coding Standards shareable config
- stylelint-rscss: Validate RSCSS conventions.
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-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. DEPRECATED - stylelint-processor-arbitrary-tags: A stylelint processor that allows you to lint CSS within arbitrary tags
If you want to run the code locally, you'll need to install docker and build the image.
Navigate to the project in your terminal and run:
docker build -t codeclimate/codeclimate-stylelint .
run npm test
or ./run-tests.sh
after building the image.
If you need something else, please open an issue.
For help with stylelint, check out their documentation.