npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-sass-lint

v1.0.5

Published

Pure Node.js sass/scss linting for Ember CLI projects

Downloads

2,322

Readme

Ember CLI Sass Lint Build Status npm

This is a pure Node.js scss/scss linter for Ember CLI apps and addons.

Installation

ember install ember-cli-sass-lint

And that's it! This addon will automatically parse your sass/scss files.

Configuration

Linting configuration can be added in a .sass-lint.yml file as required by Sass Lint. For example:

# my-project/.sass-lint.yml

rules:
  extends-before-mixins: 2 # 2 throws error
  placeholders-in-extend: 1 # 1 logs warning
  extends-before-declarations: 0 # 0 means no errors or warnings

Here is a sample config file.

Options

Options can be passed in your ember-cli-build.js in the sassLint object. The defaults are shown below:

// my-project/ember-cli-build.js

var app = new EmberApp(defaults, {
  sassLint: {
    configPath: '.sass-lint.yml',
    shouldThrowExceptions: true,
    shouldLog: true
  }
});

configPath

| Type | String | |---------|-----------------| | Default | '.sass-lint.yml' |

A name of the file your config is contained in. This should be a .yml file, preferrably in the root of the Broccoli project.

shouldThrowExceptions

| Type | Boolean | |---------|---------| | Default | true |

By default, sass-lint throws exceptions when an error is encountered (note, warnings do not throw errors). Usually this is the preferred functionality.

However, you can stop errors being thrown and, therefore, errors stopping the build process by setting shouldThrowExceptions: false. Use with caution!

shouldLog

| Type | Boolean | |---------|---------| | Default | true |

Whether to log warnings and errors to the console. When this is set to false you will not be notified or linting errors!

logError()

| Type | Function | |---------|-------------------| | Param | fileLint (Object) |

You may override this plugin's default logError() function should you need to intercept file lint objects (e.g. when testing this plugin).

// my-project/ember-cli-build.js
var errors = [];

var app = new EmberApp(defaults, {
  sassLint: {
    logError: function(fileLint) {
      errors.push(fileLint);
    }
  }
});

fileLint is passed in the format returned by sass-lint's lintText() method. you can format it using the format() function in the sass-lint package (npm install --save-dev sass-lint).

Note, when you override logError() this plugin won't log any warnings or errors.

Development

All tests are currently contained in tests/runner.js. This uses Mocha/Chai, not Ember Testing. Tests can be ran with:

npm test

You should also check that the dummy app's styles are still correctly compiled by running the ember app using ember s.

PRs are welcomed and should be issued to the master branch.