GithubHelp home page GithubHelp logo

timothyneiljohnson / sass-lint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sasstools/sass-lint

0.0 2.0 0.0 956 KB

Pure Node.js Sass linting

License: MIT License

JavaScript 79.46% CSS 20.54%

sass-lint's Introduction

Sass Lint npm version Build Status Coverage Status Dependency Status Dev Dependency Status

A Node-only Sass linter for both sass and scss syntax!

Install

npm install sass-lint --save-dev

Configuring

Use the Sample Config as a guide to create your .sass-lint.yml in the root of where you are running Sass Lint from. The default configuration can be found here.

Migrating from SCSS-Lint: If you already have a config for SCSS-Lint, you can instantly convert it to the equivalent Sass Lint config at sasstools.github.io/make-sass-lint-config.

Options

The following are options that you can use to config the Sass Linter.

Files

The files option can either be set to a glob or it can be set to an object, where the key include is set to the glob you want to include, and ignore set to either a glob string or an array of glob strings that you would like to ignore.

Rules

For all rules, setting their severity to 0 turns it off, setting to 1 sets it as a warning (something that should not be committed in), and setting to 2 set it to an error (something that should not be written). If a rule is set to just a severity, it will use the default configuration (where available).

If you want to configure options, set the rule to an array, where the first item in the array is the severity, and the second item in the array is an object including the options you would like to set.

An example configuration of a rule with options look like the following:

indentation:
  - 2
  -
    size: 2

CLI

Sass Lint v1.1.0 introduced the ability to run Sass Lint through a command line interface. See the CLI Docs for full documentation on how to use the CLI.

Creating Rules

Our AST is Gonzales-PE. Each rule will be passed the full AST which they can traverse as they please. There are many different node types that may be traversed, and an extensive API for working with nodes. The file of the rule must have the same name as the name of the rule. All of the available rules are in our rules directory. Default options will be merged in with user config.

Task Runner Integration

IDE Integration

sass-lint's People

Contributors

danpurdy avatar bgriffith avatar snugug avatar benthemonkey avatar donabrams avatar joshuacc avatar greenkeeperio-bot avatar jakubs avatar mdmoreau avatar methodgrab avatar mi2oon avatar dru89 avatar dotdat avatar alansouzati avatar andersos avatar bquorning avatar davidosomething avatar gajus avatar kaelig avatar mven avatar zallek avatar petetnt avatar

Watchers

James Cloos avatar Tim Johnson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.