Coder Social home page Coder Social logo

stylelint-scss's Introduction

stylelint-scss

npm version Build Status Coverage Status contributions welcome Downloads per month

A collection of SCSS-specific linting rules for Stylelint (in a form of a plugin).

Purpose

Stylelint by itself supports SCSS syntax very well (as well as other preprocessors' syntaxes). Moreover, it introduces some specific rules that can be used to lint SCSS, e.g. to limit nesting, control the way @-rules are written. Yet Stylelint is in general focused on standard CSS.

stylelint-scss introduces rules specific to SCSS syntax. That said, the rules from this plugin can be used with other syntaxes, like Less or some PostCSS syntaxes. That's why the rules' names are not tied to SCSS only (at-function-pattern instead of scss-function-pattern).

The plugin follows Stylelint's guidelines (about rule names, testing and so on).

Installation and usage

This plugin is used in the stylelint-config-standard-scss shared config. We recommend using that shared config, rather than installing this plugin directly.

However, the plugin can still be used in you're crafting a config from the ground up. First, install stylelint-scss (and stylelint, if you haven't done so yet) via npm:

npm install stylelint stylelint-scss

Create the .stylelintrc.json config file (or open the existing one), add stylelint-scss to the plugins array and the rules you need to the rules list. All rules from stylelint-scss need to be namespaced with scss.

{
  "plugins": [
    "stylelint-scss"
  ],
  "rules": {
    // recommended rules
    "at-rule-no-unknown": null,
    "scss/at-rule-no-unknown": true,
    // ...
    // any other rules you'd want to change e.g.
    "scss/dollar-variable-pattern": "^foo",
    "scss/selector-no-redundant-nesting-selector": true
  }
}

Please refer to Stylelint docs for detailed info on using this linter.

List of rules

Here are stylelint-scss' rules, grouped by the thing they apply to (just like in Stylelint).

Please also see the example configs for special cases.

@-each

  • at-each-key-value-single-line: This is a rule that checks for situations where users have done a loop using map-keys or map.keys and grabbed the value for that key inside of the loop.

@-else

@-extend

@-function

@-if

@-import

@-mixin

@-rule

@-use

$-variable

%-placeholder

//-comment

Comment

Declaration

Dimension

Function

Map

Media feature

Operator

Partial

Selector

General / Sheet

Help out

The work on the plugin's rules is still in progress, so if you feel like it, you're welcome to help out with any of these (the plugin follows Stylelint guidelines so most of this is based on its docs):

  • Create, enhance, and debug rules (see Stylelint's guide to "Working on rules").
  • Improve documentation.
  • Chime in on any open issue or pull request.
  • Open new issues about your ideas on new rules, or for how to improve the existing ones, and pull requests to show us how your idea works.
  • Add new tests to absolutely anything.
  • Work on improving performance of rules.
  • Contribute to Stylelint
  • Spread the word.

We communicate via issues and pull requests.

There is also StackOverflow, which would be the preferred QA forum.

Contributors

Thanks goes to these wonderful people:

kristerkari dryoma rambleraptor XhmikosR Eugeno joseph118
kristerkari dryoma rambleraptor XhmikosR Eugeno joseph118
ybiquitous stof niksy kaysonwu srawlins pipopotamasu
ybiquitous stof niksy kaysonwu srawlins pipopotamasu
jhae-de OriR ntwb ricardogobbosouza jeddy3 kevindew
jhae-de OriR ntwb ricardogobbosouza jeddy3 kevindew
thibaudcolas chimurai AndyOGo bjankord chalkygames123 xboy2012
thibaudcolas chimurai AndyOGo bjankord chalkygames123 xboy2012
vseventer SterlingVix Calme1709 Deimos diego-codes lithiumlron
vseventer SterlingVix Calme1709 Deimos diego-codes lithiumlron
EvanHahn guoyunhe jantimon stormwarning keegan-lillo manovotny
EvanHahn guoyunhe jantimon stormwarning keegan-lillo manovotny
nlydv pamelalozano16 paulgv sajadtorkamani YozhikM AM-77
nlydv pamelalozano16 paulgv sajadtorkamani YozhikM AM-77
kersh YodaDaCoda freezy-sk qmhc
kersh YodaDaCoda freezy-sk qmhc

Important documents

stylelint-scss's People

Contributors

kristerkari avatar dryoma avatar dependabot[bot] avatar rambleraptor avatar xhmikosr avatar greenkeeper[bot] avatar eugeno avatar joseph118 avatar ybiquitous avatar stof avatar niksy avatar kaysonwu avatar srawlins avatar pipopotamasu avatar jhae-de avatar orir avatar ntwb avatar ricardogobbosouza avatar jeddy3 avatar evilebottnawi avatar kevindew avatar thibaudcolas avatar chimurai avatar vseventer avatar xboy2012 avatar chalkygames123 avatar bjankord avatar andyogo avatar qmhc avatar freezy-sk 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.