6.2.1 • Published 23 days ago

stylelint-scss v6.2.1

Weekly downloads
979,735
License
MIT
Repository
github
Last release
23 days ago

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

Block

Comment

Declaration

Dimension

Function

Map

Media feature

Operator

Partial

Property

Selector

Load

General / Sheet

Deprecated

These rules are deprecated — we won't fix bugs nor add options, and we will remove them in the next major release. We recommend you use a pretty printer (like Prettier) alongside Stylelint rather than these rules.

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:

Important documents

@yattho/stylelint-config@she11sh0cked/stylelint-config@qulix/stylelint-config-scss@eui/deps-base@nmacarthur/reveal@knapsack-cloud/msk-design-systemui-portal@nodeart/stylelintstylelint-config-wpstylelint-plugin-ege-standard@kolesa-group/stylelint-configstylelint-ege-standardkolesa-group-stylelint-configkg-stylelint-configiamnewton-stylelint-configmo-foundation-basestylelint-config-fernandopasik@dry-stack/devtoolst-kvlnk-configsstylelint-config-nonsensicalstylelint-nonsensical-configstylelint-config-nonsense@alotool/bloggerpack8haodi-font-end-check-configfont-end-check-config-8haodi@conten2/stylelint-configstylelint-config-that-you-dont-need@scss-toolkit/config-stylelint@sno2wman/stylelint-config@verzola/bass@selfagencyllc/sass-starter@dianmi-fe/lint@david92219/test-npm-moduletct-core-stylesstylelint-config-lmzkckstylelint-config-metamostylelint-config-airkrostylelint-config-hades@spothero/stylelint-config@xeho91/stylelint-config@apeiwan/pi-play@alotool/alotool-cli@bingumd/stylelint-config@marissen/stylelint-config@smb-fe/stylelint-config-standardstylelint-config-jzegstylelint-config-runroomstylelint-config-sevenvalzeslint@appworks/spectaro-uilibrainbow-codelint@furdzik/stylelint-config@lithiumlron/stylelint-config-scssstylelint-config-trigen@clevercanyon/utilities-dev-npmstylelint-config-condcra-template-smart@infinitebrahmanuniverse/nolb-stylelint-s@soyhuce/stylelint-config-scss@thequack/shared@godismyjudgebro/stylelint-config@redco/stylelint-config-hdred@smb-org/stylelint-config-standardstylelint-config-oakf3elintopea-bootstraaprlintstylelint-config-primergo2-fe-stylelint-config@everything-registry/sub-chunk-2842@robinblomberg/stylelint-config-hac-stylelint@bemoid/stylelint-config-scssspeed-lintfe-encode-lintflare-dispatchstylelint-miszoember-bedrocklin3s-distributionlincd-serverlinter-bundlehiui-extendsholokit-monorepohfex-stylelint-configi-magic-linti-lint-testhzlintkleros-js-scriptskleros-scriptskk-webpack-base--configko-lint-configkolibri-toolsguanglong-lintgulp-drupal-stacklbglisting-clilaravel-elixir-stylelint-helperleostar-lintj2elintjekyll-react-webpackmoga-lint
6.2.1

23 days ago

6.2.0

25 days ago

6.1.0

2 months ago

5.3.2

4 months ago

6.0.0

4 months ago

5.3.1

5 months ago

5.3.0

5 months ago

5.1.0

8 months ago

5.2.1

6 months ago

5.2.0

7 months ago

5.0.1

10 months ago

4.4.0

1 year ago

4.6.0

1 year ago

5.0.0

11 months ago

4.5.0

1 year ago

4.7.0

11 months ago

4.3.0

2 years ago

4.2.0

2 years ago

4.0.1

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

4.0.0-0

2 years ago

4.0.0-1

2 years ago

4.0.0-2

2 years ago

3.21.0

3 years ago

3.20.1

3 years ago

3.20.0

3 years ago

3.19.0

3 years ago

3.18.0

4 years ago

3.17.2

4 years ago

3.17.1

4 years ago

3.17.0

4 years ago

3.16.1

4 years ago

3.16.0

4 years ago

3.15.0

4 years ago

3.14.2

4 years ago

3.14.1

4 years ago

3.14.0

4 years ago

3.13.0

4 years ago

3.12.1

4 years ago

3.12.0

4 years ago

3.11.1

5 years ago

3.11.0

5 years ago

3.10.1

5 years ago

3.10.0

5 years ago

3.9.4

5 years ago

3.9.3

5 years ago

3.9.2

5 years ago

3.9.1

5 years ago

3.9.0

5 years ago

3.8.0

5 years ago

3.7.0

5 years ago

3.6.1

5 years ago

3.6.0

5 years ago

3.5.4

5 years ago

3.5.3

5 years ago

3.5.2

5 years ago

3.5.1

5 years ago

3.5.0

5 years ago

3.4.4

5 years ago

3.4.3

5 years ago

3.4.2

5 years ago

3.4.1

5 years ago

3.4.0

5 years ago

3.3.2

5 years ago

3.3.1

6 years ago

3.3.0

6 years ago

3.2.0

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.0.0-alpha.1

8 years ago

0.0.0

8 years ago