All Projects → rstacruz → Stylelint Rscss

rstacruz / Stylelint Rscss

Licence: mit
Validate CSS with RSCSS conventions

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Stylelint Rscss

Frasco
Quick starter for Jekyll including full setup for Sass, PostCSS, Autoprefixer, stylelint, Webpack, ESLint, imagemin, Browsersync, etc.
Stars: ✭ 123 (+70.83%)
Mutual labels:  stylelint, sass
Bathe
The simplest WordPress starter theme including full setup for Sass, PostCSS, Autoprefixer, stylelint, Webpack, Eslint, imagemin, Browsersync, etc.
Stars: ✭ 65 (-9.72%)
Mutual labels:  stylelint, sass
Magento2 Frontools
Set of front-end tools for Magento 2 based on Gulp.js
Stars: ✭ 416 (+477.78%)
Mutual labels:  stylelint, sass
Static Site Boilerplate
A better workflow for building modern static websites.
Stars: ✭ 1,633 (+2168.06%)
Mutual labels:  stylelint, sass
Stylefmt
stylefmt is a tool that automatically formats stylesheets.
Stars: ✭ 2,123 (+2848.61%)
Mutual labels:  stylelint, sass
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (+261.11%)
Mutual labels:  stylelint, sass
Webpack Es6 Sass Setup
A basic setup for Webpack with ES6, Babel, Sass and stylelint
Stars: ✭ 63 (-12.5%)
Mutual labels:  stylelint, sass
Organizr Plex Theme
🎨 A theme for Organizr that emulates the style of Plex
Stars: ✭ 62 (-13.89%)
Mutual labels:  sass
Jekyll Netlify Boilerplate
A simple Jekyll template for creating a fast, static website on Netlify
Stars: ✭ 62 (-13.89%)
Mutual labels:  sass
Flake8
The official GitHub mirror of https://gitlab.com/pycqa/flake8
Stars: ✭ 1,112 (+1444.44%)
Mutual labels:  stylelint
Stylelint Config Standard
The standard shareable config for stylelint
Stars: ✭ 1,108 (+1438.89%)
Mutual labels:  stylelint
Dotfiles.github.com
Your unofficial guide to doing dotfiles on GitHub.
Stars: ✭ 1,124 (+1461.11%)
Mutual labels:  sass
Lint Staged
🚫💩 — Run linters on git staged files
Stars: ✭ 9,492 (+13083.33%)
Mutual labels:  stylelint
Egeo
EGEO is the open-source UI library used to build Stratio's UI. It includes UI Components, Utilities, Services and much more to build user interfaces quickly and with ease. The library is distributed in AoT mode.
Stars: ✭ 69 (-4.17%)
Mutual labels:  sass
Libsasshost
.NET wrapper around the LibSass library with the ability to support a virtual file system.
Stars: ✭ 71 (-1.39%)
Mutual labels:  sass
Eleventy Webpack
A barebone Eleventy and Webpack boilerplate 🎈
Stars: ✭ 68 (-5.56%)
Mutual labels:  sass
Stylelint Declaration Block No Ignored Properties
Disallow property values that are ignored due to another property value in the same rule.
Stars: ✭ 65 (-9.72%)
Mutual labels:  stylelint
Sass.js
Sass.js - API for emscripted libsass to run in the browser
Stars: ✭ 1,111 (+1443.06%)
Mutual labels:  sass
Stylelint Validator
Stylelint plugin to validate CSS syntax
Stars: ✭ 64 (-11.11%)
Mutual labels:  stylelint
Propeller
Propeller - Develop more, Code less. Propeller is a front-end responsive framework based on Google's Material Design Standards & Bootstrap.
Stars: ✭ 1,150 (+1497.22%)
Mutual labels:  sass

stylelint-rscss

Validate CSS (and SCSS, Less, SugarSS) to RSCSS conventions

stylelint-rscss is a plugin for stylelint to validate your code against RSCSS conventions. It supports SCSS (Sass), SugarSS and Less, as supported by stylelint.

As a stylelint plugin, it can be used with stylelint's hundreds of rules or other stylelint configs to validate other good CSS practices as well.

Status


Quickstart guide

Install: Install stylelint and stylelint-rscss to your project.

npm install --save-dev stylelint stylelint-rscss

Configure: Create a .stylelintrc in your project. Use the stylelint-rscss/config configuration, which has defaults for strict RSCSS conventions.

// .stylelintrc
{
  "extends": [
    "stylelint-rscss/config"
  ]
}

Add a script: Add an npm script to your package.json.

// package.json
{
  "scripts": {
    "lint:css": "stylelint path/to/css/**/*"
  }
}

Run it!

npm run lint:css

Recommendations

These steps are not required, but are highly recommended:


Text editor support

You need to install stylelint globally (npm install -g stylelint) for text editor support.

npm install -g stylelint

After that, here are the plugins I'd recommend:

Also see stylelint's complimentary tools documentation.


Examples

Here are some valid examples according to RSCSS rules.

.component-name { }
  // ✓ Components should be two or more words, separated by dashes.
.component-name > .element { }
  // ✓ Elements should be one word. Use `>` to denote markup structure.
.component-name > .element.-foo { }
  // ✓ Variant classes begin with a dash (`-`).
.component-name.-variant { }
  // ✓ Components can have variants.
._helper { }
  // ✓ Helpers start with an underscore (`_`).

Some cases not allowed:

.component-name .element { }
  // ✗ Use `>` to denote markup structure.
.component-name.variant { }
  // ✗ Variants must begin with a dash.
.componentname { }
  // ✗ Components should be two or more words.
.component-name.other-component { }
  // ✗ Only one component name is allowed.
.component-name > .-foo { }
.-foo { }
  // ✗ Variants should be attached to components or elements.

Also OK:

h2 { }
  // ✓ Bare elements can be styled.
.component-name > h2 { }
  // ✓ Bare elements can be styled as elements.
.component-name > a:hover[aria-hidden="false"] { }
  // ✓ Pseudo-classes and attributes are OK.
.component-name:hover > .element { }
  // ✓ They're ok for components too.

See Rules for more examples.


Rules and customization

See Rules for a detailed lint of rules and examples of how to customize stylelint-rscss.


Thanks

stylelint-rscss © 2016+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

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].