Task for GrumPHP that adds CSS linting support with stylelint. An easy way to enforce convention and avoid errors in your styles

Overview

grumphp-stylelint-task

Installation

Stylelint is a static analysis tool for styles. A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.

composer require --dev adrifkat/grumphp-stylelint-task

npm

1. Use npm to install stylelint and its standard configuration:

npm install --save-dev stylelint stylelint-config-standard

2. Create a .stylelintrc.json configuration file in the root of your project:

{
  "extends": "stylelint-config-standard"
}

Config

It lives under the stylelint namespace and has the following configurable parameters:

# grumphp.yml
grumphp:
    tasks:
        stylelint:
            triggered_by: [css, scss, less]
            whitelist_patterns:
                - /^resources\/css\/(.*)/
            config: .stylelintrc.json
            max-warnings: 5
            quiet: false
      
services:
  Adrifkat\GrumPHPStylelint\StylelintTask:
    arguments:
      - '@process_builder'
      - '@formatter.raw_process'
    tags:
      - { name: grumphp.task, task: stylelint }

triggered_by

Default: [less, sass, scss, css]

This is a list of extensions which will trigger the Stylelint task.

whitelist_patterns

Default: []

This is a list of regex patterns that will filter files to validate. With this option you can specify the folders containing style files and thus skip folders like the /vendor/ directory. This option is used in conjunction with the parameter triggered_by. For example: to whitelist files in resources/css/ (Laravel's CSS directory) you can use:

whitelist_patterns:
  - /^resources\/css\/(.*)/

config

Default: null

Path to a JSON, YAML, or JS file that contains your configuration object. Not necessary if using a standard stylelintrc name, eg. .stylelintrc.json

max-warnings

Default: null

Set a limit to the number of warnings accepted. (stylelint.io).

quiet

Default: null

Only register violations for rules with an "error"-level severity (ignore "warning"-level). (stylelint.io)

You might also like...
Foundation 3 Framework for Magento 1.7. Foundation styles and libraries. Magento Responsive theme. Off-canvas Left-Right sidebar columns for mobile.

Magento Foundation 3 Framework Zurb Foundation 3 framework for Magento 1.7. Magento Foundation 3 Version 1.3.0. Demo page: http://magendation.internet

The ErrorHandler component provides tools to manage errors and ease debugging PHP code

ErrorHandler Component The ErrorHandler component provides tools to manage errors and ease debugging PHP code. Getting Started $ composer require symf

The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts.

Sitemap_index.xml The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts

PHP errors for cool kids
PHP errors for cool kids

whoops PHP errors for cool kids whoops is an error handler framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debu

Tailwind UI is a Tailwind CSS component library designed by the authors of Tailwind CSS
Tailwind UI is a Tailwind CSS component library designed by the authors of Tailwind CSS

Tailwind UI is a Tailwind CSS component library designed by the authors of Tailwind CSS. This is a Winter CMS plugin that provides a custom, TailwindUI-based skin for the backend.

Silverstripe-fulltextsearch - Adds external full text search engine support to SilverStripe

FullTextSearch module Adds support for fulltext search engines like Sphinx and Solr to SilverStripe CMS. Compatible with PHP 7.2 Important notes when

Pug-php adds inline PHP scripting support to the Pug template compiler

Pug-php adds inline PHP scripting support to the Pug template compiler. Since version 3, it uses Phug, a very customizable Pug template engine made by the tale-pug and pug-php developers as the new PHP Pug engine reference.

Adds support for quickly adding a "snow day" banner at the top of a website.

❄️ Snow Day Plugin 🚨 Requires OctoberCMS 2.0 ✨ What does this plugin do? Provides the ability to quickly add a cross-site banner using a component. ❓

Adds a compact
Adds a compact "easy-sort" mode to Repeater and Repeater Matrix, making those fields easier to sort when there are a large number of items.

Repeater Easy Sort Adds a compact "easy-sort" mode to Repeater and Repeater Matrix, making those fields easier to sort when there are a large number o

Releases(1.0.1)
Owner
null
Fixes WordPress 5.9 global CSS styles specificity issues

Fixes WordPress 5.9 global CSS styles specificity issues

Oliver Juhas 3 Feb 22, 2022
Test and enforce architectural rules in your Laravel applications. Keep your app's architecture clean and consistent!

Laravel Arkitect Laravel Arkitect lets you test and enforce your architectural rules in your Laravel applications, and it's a PHPArkitect wrapper for

SMorteza Ebadi 55 Dec 17, 2022
Magento 2 GDPR extension Free by Magepow helps websites comply with GDPR regulations, allowing customers to control personal data and avoid penalties.

Magento 2 GDPR extension Free by Magepow helps websites comply with GDPR regulations, allowing customers to control personal data and avoid penalties.

https://magepow.com 10 Dec 30, 2022
Small convention based CQRS library for PHP

LiteCQRS for PHP Small naming-convention based CQRS library for PHP (loosely based on LiteCQRS for C#) that relies on the MessageBus, Command, EventSo

Benjamin Eberlei 560 Nov 20, 2022
Enforce that your classes get only instantiated by the factories you define!

Enforce that your classes get only instantiated by the factories you define!

null 3 Nov 15, 2021
A Laravel 9 package that allows you enforce security of your artisan commands by authenticating users before running.

Introduction This package allows you as a developer to restrict who can and cannot run artisan commands, especially in a production environment. For e

YOo Slim 2 Sep 15, 2022
Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.

Laravel Blog Have you worked with Wordpress? Developers call this package wordpress-like laravel blog. Give our package a Star to support us ⭐ ?? Inst

Binshops 279 Dec 28, 2022
A Pocketmine-MP (PMMP) plugin to help staff members enforce the rules of the server.

StaffMode is an all-in-one Pocketmine-MP (PMMP) moderation plugin made to simplify the life of staff members.

ItsMax123 9 Sep 17, 2022
MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query and get result in a fastest way

Mysql Optimizer mysql optimizer also known as MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query

null 2 Nov 20, 2021
Silverstripe-tinytidy - Control which styles are available in TinyMCE's style dropdown menu and what elements they can be applied to

TinyTidy for SilverStripe This module mainly serves as an example of how to customise the 'styles' dropdown menu in the TinyMCE editor to control whic

Jono Menz 30 Jul 30, 2020