All Projects → tomasbasham → Ember Cli Scss Lint

tomasbasham / Ember Cli Scss Lint

Licence: mit
An ember-cli addon to integrate sass-lint for standards adherence and improved style consistency

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ember Cli Scss Lint

ember-cli-nouislider
{{range-slider}} component for ember-cli powered by noUiSlider
Stars: ✭ 43 (+514.29%)
Mutual labels:  ember-cli, ember-addon
ember-content-loader
Easy, customizable content placeholders / skeletons screens
Stars: ✭ 41 (+485.71%)
Mutual labels:  ember-cli, ember-addon
ember-cli-string-helpers
Set of the String helpers extracted from DockYard's ember-composable-helpers.
Stars: ✭ 73 (+942.86%)
Mutual labels:  ember-cli, ember-addon
Ember Cli Github Pages
Easily manage gh-pages of your ember-cli addon
Stars: ✭ 164 (+2242.86%)
Mutual labels:  ember-cli, ember-addon
Css
Believe in Better CSS
Stars: ✭ 262 (+3642.86%)
Mutual labels:  scss, stylesheets
Ember Cli Notifications
⚛ Atom inspired notification messages for ember-cli
Stars: ✭ 168 (+2300%)
Mutual labels:  ember-cli, ember-addon
ember-youtube
An Ember.js component to load, play and control YouTube videos using the iframe API
Stars: ✭ 57 (+714.29%)
Mutual labels:  ember-cli, ember-addon
Ember Cli Coffeescript
Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
Stars: ✭ 72 (+928.57%)
Mutual labels:  ember-cli, ember-addon
ember-credit-card
"make your credit card form dreamy in one line of code"
Stars: ✭ 89 (+1171.43%)
Mutual labels:  ember-cli, ember-addon
ember-luxon
🕐 🌐 [deprecated] Addon thats brings Luxon to Ember applications.
Stars: ✭ 20 (+185.71%)
Mutual labels:  ember-cli, ember-addon
Ember Model Validator
ember-cli addon adds validation support to your Ember-Data models.
Stars: ✭ 141 (+1914.29%)
Mutual labels:  ember-cli, ember-addon
Ember Decorators
Useful decorators for Ember applications.
Stars: ✭ 360 (+5042.86%)
Mutual labels:  ember-cli, ember-addon
Ember Cli Stripe
Stripe checkout for Ember
Stars: ✭ 84 (+1100%)
Mutual labels:  ember-cli, ember-addon
ember-template-inspector
An ember add-on which opens the template file in the code editor while inspecting an element.
Stars: ✭ 15 (+114.29%)
Mutual labels:  ember-cli, ember-addon
Ember Cli Bundle Analyzer
Analyze the size and contents of your Ember app's bundles
Stars: ✭ 78 (+1014.29%)
Mutual labels:  ember-cli, ember-addon
ember-cli-es6-transform
Import ES6 modules from npm, bower or anywhere else in your app.
Stars: ✭ 13 (+85.71%)
Mutual labels:  ember-cli, ember-addon
Prejss
Get the power of PostCSS with plugins in your JSS styles. 🎨 Just put CSS into JS and get it as JSS object.
Stars: ✭ 238 (+3300%)
Mutual labels:  scss, stylesheets
Ember Simple Auth Auth0
Auth0 + lock.js, built on ember-simple-auth
Stars: ✭ 53 (+657.14%)
Mutual labels:  ember-cli, ember-addon
ember-cli-ifa
Ember CLI addon for injecting fingerprinted asset map file into Ember app
Stars: ✭ 54 (+671.43%)
Mutual labels:  ember-cli, ember-addon
Stylesheet
The GTK Stylesheet for elementary OS
Stars: ✭ 260 (+3614.29%)
Mutual labels:  scss, stylesheets

ember-cli-scss-lint Build Status Maintainability

An Ember CLI addon to integrate sass-lint for standards adherence and improved style consistency.

One of the many great features of Ember CLI is its rich toolset surrounding the framework such as eslint. This provides you with the ability to more easily write consistent and self documenting code that any developer could understand. However there is currently no similar feature to lint your stylesheets.

If you choose to compose your stylesheets using a preprocessor language such as SCSS you will equally find no support to ensure your code follows best practice. This addon solves this by integrating the sass-lint nodejs package into the Ember CLI build process.

Previous versions of this addon made use of the Ruby implementation of scss-lint. However the Sass core team is now building Sass in Dart instead of Ruby, and will no longer be maintaining the Ruby implementation. Since scss-lint relies on the Ruby Sass implementation, this means it will eventually not support the latest Sass features and bug fixes. As such sass-lint has taken over in it's place which offers better integration into an already JavaScript pipeline.

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above

Installation

From within your Ember CLI project directory run:

ember install ember-cli-scss-lint

Usage

Every time you run an Ember CLI process that requires building the application (ember server, ember test, ember build) your stylesheets will be linted and any errors output to the command line.

$ ember s
version: 1.13.13
Livereload server on http://localhost:49154
Serving on http://localhost:4200/

partials/_pagination.scss
  1:1   warning  Type-selector should be nested within its parent Class   force-element-nesting
  1:1   warning  Class should be nested within its parent Type-selector   force-element-nesting
  1:24  warning  Qualifying elements are not allowed for class selectors  no-qualifying-elements

✖ 3 problems (0 errors, 3 warnings)

Build successful - 24281ms.

Configuration

sass-lint.yml

Linting can be configured by creating a .sass-lint.yml file in the root directory of your Ember CLI project alongside your .eslintrc file. If you already have a config for scss-lint, you can instantly convert it to the equivalent sass-lint config here.

Configuration Example
files:
  include: '**/*.scss'

options:
  formatter: stylish
  merge-default-rules: false

rules:
  border-zero:
    - 1
    - convention: zero

  brace-style:
    - 1
    - allow-single-line: true

  ...

ember-cli-build.js

Any configuration option you can set within the .sass-lint.yml file can also be set within the ember-cli-build.js file of the consuming application. Any option here will take precedence over those in the .sass-lint.yml file. This is useful when needing to programmatically define rule sets depending upon some condition.

JavaScript Configuration Example
// ember-cli-build.js
const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    scssLintOptions: {
      rules: [
        'border-zero': 2,
        'brace-style': 0
      ]
    }
  });

  return app.toTree();
};

For more information on the available rules see the sass-lint linters documentation.

Adding trees

By default this addon forwards the entire app tree to be linted, but will not lint any files outside of the app folder. For most use cases this will be sufficient, but for others this is limiting. If for example you wish to lint files contained within the vendor tree you must tell the addon to do so. This can be done within the ember-cli-build.js file.

Trees Example
// ember-cli-build.js
const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    scssLintOptions: {
      includePaths: [
        'vendor'
      ]
    }
  });

  return app.toTree();
};

License

This project is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].