Skip to content

A Code Climate engine for the mighty, modern CSS linter

Notifications You must be signed in to change notification settings

gilbarbara/codeclimate-stylelint

Repository files navigation

Code Climate Stylelint Engine

Maintainability

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.

Installation

  1. If you haven't already, install the Code Climate CLI.
  2. Run codeclimate engines:install stylelint. This command both installs the engine and enables it in your .codeclimate.yml file.
  3. Add a stylelint config file.
  4. You're ready to analyze! Browse into your project's folder and run codeclimate analyze.

Configuration Options

  • ignore_warnings: true|false (default false) - skip warnings with styletint quiet flag
  • config: Specify a relative path for the configuration file. (ex: config/.stylelintrc)

Configs

Processors

This engine has support for the recommended processors:

Plugins

This engine has support for the recommended plugins:

If you need something else, please open an issue.

Development

To run the code locally, you'll need to install codeclimate's CLI and docker.
Navigate to the package directory in your terminal and run:

npm run build
npm test

Adding packages

Install the desired packages as dependencies and test it.

If it is a plugin, add it to the .stylelint config in the test/stylelint-plugins directory and make sure it trigger some issues. Update the snapshot file with the new issue count.

If it is a config or processor, add a new directory inside the tests directory with the name of the package and make sure it trigger some issues.

Before commiting your changes run the tests!

Something else, please open an issue.

Need help?

For help with stylelint, check out their documentation.