All Projects → wikimedia → grunt-stylelint

wikimedia / grunt-stylelint

Licence: MIT license
Stylelint adapter for the Grunt task runner.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to grunt-stylelint

wpcs-docs
WordPress Coding Standards Docs
Stars: ✭ 59 (+126.92%)
Mutual labels:  stylelint, coding-standards
react-typescript-boilerplate
A React + Redux + TypeScript + HOT + Webpack + Material-UI + Sass boilerplate
Stars: ✭ 18 (-30.77%)
Mutual labels:  stylelint
stylelint-config
App for generating stylelint config online
Stars: ✭ 100 (+284.62%)
Mutual labels:  stylelint
Codor
Custom PHPCS sniffs to find Code Smells
Stars: ✭ 40 (+53.85%)
Mutual labels:  coding-standards
eslint-config-naver
Naver JavaScript Coding Conventions rules for eslint
Stars: ✭ 184 (+607.69%)
Mutual labels:  coding-standards
stylelint-selector-tag-no-without-class
Stylelint plugin to disallow certain tags without a class qualifier in selectors
Stars: ✭ 19 (-26.92%)
Mutual labels:  stylelint
EditorConfig-Action
🔎A GitHub Action to check, enforce & fix EditorConfig style violations
Stars: ✭ 40 (+53.85%)
Mutual labels:  stylelint
stylelint-bare-webpack-plugin
Stylelint plugin for webpack
Stars: ✭ 15 (-42.31%)
Mutual labels:  stylelint
stylelint-config-xo
Stylelint shareable config for XO
Stars: ✭ 34 (+30.77%)
Mutual labels:  stylelint
bowman
A simple static site generator with an integrated toolchain for efficient development and delivery.
Stars: ✭ 17 (-34.62%)
Mutual labels:  stylelint
vue3-vite-ts
Vue 3 Scaffolding (Vite + TS + Linters + Jest + TailwindCSS)
Stars: ✭ 27 (+3.85%)
Mutual labels:  stylelint
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (+76.92%)
Mutual labels:  stylelint
stylelint-no-indistinguishable-colors
Stylelint plugin to add rule no-indistinguishable-colors
Stars: ✭ 15 (-42.31%)
Mutual labels:  stylelint
wptide
🌊 Tide is a series of automated tests run against every WordPress.org theme and plugin
Stars: ✭ 77 (+196.15%)
Mutual labels:  coding-standards
coding-standard
Consistence - Coding Standard - PHP Code Sniffer rules
Stars: ✭ 73 (+180.77%)
Mutual labels:  coding-standards
php-codesniffer-sniffs
Custom sniffs for PHP_CodeSniffer
Stars: ✭ 16 (-38.46%)
Mutual labels:  coding-standards
fe-standard-config-seed
前端通用代码规范自动化接入
Stars: ✭ 18 (-30.77%)
Mutual labels:  stylelint
linter-sniffer-pretty-printer
Collection of packages and configs to lint and format code in your WordPress project.
Stars: ✭ 35 (+34.62%)
Mutual labels:  stylelint
bootstrap-shopify-theme
🛍 A free Shopify Theme built with Bootstrap, BEM, Liquid, Sass, ESNext, Theme Tools, ... and Webpack.
Stars: ✭ 41 (+57.69%)
Mutual labels:  stylelint
sniff
Simpler PHP code sniffer built on top of PHP-CS-Fixer.
Stars: ✭ 14 (-46.15%)
Mutual labels:  coding-standards

NPM version Build Status dependencies Status devDependencies Status NPM Downloads

grunt-stylelint

Grunt plugin for running stylelint

Getting started

If this is the first time you're using Grunt, the getting started guide will show you how to get up and running.

Once you have that installed, with a Gruntfile set for your code, you can install the plugin with:

npm install grunt-stylelint stylelint --save-dev

Note that this installs both grunt-stylelint and the stylelint tool itself, which is a peer dependency. If you do not explicitly depend on stylelint in your package.json file and do not have it available, grunt-stylelint will not work. Modern versions of npm will warn you of such unmet peer dependencies.

In your Gruntfile, add the line:

grunt.loadNpmTasks( 'grunt-stylelint' );

Running and configuring stylelint task

Run this task with the grunt stylelint command.

You can specify the targets and options for the task using the normal Grunt configuration – see Grunt's guide on how to configure tasks in general.

For more explanations of the lint errors stylelint will throw at you please visit http://stylelint.io/.

Usage examples

Example simple config

In this example, running grunt stylelint:all (or grunt stylelint because stylelint is a multi task) will lint the project's CSS and Sass files in the css and sass directories and their subdirectories, using the default stylelint options or the options specified in the .stylelintrc in the root of the project. For an example config see http://stylelint.io/user-guide/example-config/.

// Project configuration.
grunt.initConfig({
  stylelint: {
    all: ['css/**/*.css', 'sass/**/*.scss']
  }
});

Example full config

A full set of config with default options would be:

// Project configuration.
grunt.initConfig( {
  stylelint: {
    options: {
      configFile: '.stylelintrc',
      formatter: 'string',
      ignoreDisables: false,
      failOnError: true,
      outputFile: '',
      reportNeedlessDisables: false,
      fix: false,
      syntax: ''
    },
    src: [
            'src/**/*.{css,less,scss}',
            ,
            '!src/badstyles/*.css'
        ]
    }
}

Options

The options object is passed through to stylelint. Options you may wish to set are:

formatter

Type: function or string Default value: "string" Values: "string"|"verbose"|"json"

In which output format would you like results. If grunt is run with --verbose and this is not explicitly set, it will act as though you passed in "verbose".

ignoreDisables

Type: boolean Default value: false

Whether to ignore inline comments that disable stylelint.

outputFile

Type: string

Output the report to a file.

reportNeedlessDisables

Type: boolean Default value: false

Whether to ignore inline comments that disable stylelint and report which ones did not block a lint warning.

failOnError

Type: boolean Default value: true

Whether to fail if stylelint detects an error.

fix

Type: boolean Default value: false

Automatically fix, where possible, violations reported by rules. If grunt is run with --fix and this is not explicitly set, it will be set to true.

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