adrifkat / grumphp-stylelint-task
GrumPHP stylelint task
Installs: 1 159
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- composer/composer: ^1.6
- phpro/grumphp: ^1.3
This package is auto-updated.
Last update: 2024-11-06 04:40:33 UTC
README
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)