ember-cli-csslint

1.0.1 • Public • Published

ember-cli-csslint Build Status

Lint your Ember app's CSS as part of the build process. This addon lints the CSS after the preprocessors (using the postprocess hook) so you can lint the resulting CSS after the Sass/Less preprocessors.

Installation

ember install:addon ember-cli-csslint

Usage

It is recommended to create a .csslintrc in your project root with the following exclude-list in order to ignore vendor and test-support CSS:

{
  "exclude-list": [
    "assets/vendor.css",
    "assets/test-support.css"
  ]
}

Now, when you run ember build, the CSS Linting will be automatically run:

ember build
version: 0.1.2
Building
app.css: line 2, col 3, Use of !important,
app.css: line 5, col 1, Don't use adjoining classes.,
app.css: line 5, col 1, Rule is empty.
3 errors

===== 3 CSSLint Errors

Built project successfully. Stored in "dist/".

To customize your linting, create a .csslintrc in your project root. Here's an example .csslintrc that doesn't complain about the use of !important:

{
  "important": false
}

For more information on the available rules see the csslint wiki.

Development

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

TODO:

  • Ensure the linting occurs on every build, including when the server is running.
  • Beautify the output.
  • Allow configuration for the styles directory (in case app/styles isn't used).
  • Allow configuration to specify the output CSS (in case a preprocessor is used).

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander (@4lpine).

Package Sidebar

Install

npm i ember-cli-csslint

Weekly Downloads

9

Version

1.0.1

License

MIT

Last publish

Collaborators

  • johno