Skip to content

Commit 35cc7d7

Browse files
authored
Merge pull request #1 from Space48/S48-638-add-stylelint
S48-638: Configure stylelint task
2 parents 474d8af + 1003495 commit 35cc7d7

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

.stylelintrc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"rules": {
3+
"indentation": 4,
4+
"no-descending-specificity": true,
5+
"block-opening-brace-space-before": "always",
6+
"block-opening-brace-newline-after": "always",
7+
"block-closing-brace-newline-before": "always",
8+
"selector-list-comma-newline-after": "always",
9+
"selector-pseudo-element-colon-notation": "double",
10+
"string-quotes": "single",
11+
"selector-combinator-space-after": "always",
12+
"selector-combinator-space-before": "always",
13+
"declaration-block-semicolon-newline-after": "always",
14+
"declaration-colon-space-after": "always",
15+
"declaration-colon-space-before": "never",
16+
"declaration-empty-line-before": "never",
17+
"declaration-block-trailing-semicolon":"always",
18+
"no-extra-semicolons": true,
19+
"declaration-block-semicolon-space-before": "never",
20+
"declaration-no-important": true,
21+
"comment-empty-line-before": "always",
22+
"comment-whitespace-inside": "always",
23+
"comment-no-empty": true,
24+
"selector-max-id": 0,
25+
"selector-class-pattern": "^_?[a-z0-9]+(-[a-z0-9]+)*$",
26+
"selector-type-case": "lower",
27+
"max-nesting-depth": 4,
28+
"length-zero-no-unit": true,
29+
"number-leading-zero": "never",
30+
"number-no-trailing-zeros": true,
31+
"unit-case": "lower",
32+
"color-hex-case": "lower",
33+
"color-no-invalid-hex": true,
34+
"color-hex-length": "short",
35+
"block-no-empty": true,
36+
"max-empty-lines": 1,
37+
"unit-whitelist": ["px", "rem", "%", "fr", "vw", "vh", "s", "deg"],
38+
"declaration-block-no-duplicate-properties": true,
39+
"declaration-block-no-shorthand-property-overrides": true,
40+
"shorthand-property-no-redundant-values": true,
41+
"declaration-block-no-redundant-longhand-properties": true,
42+
"no-duplicate-selectors": true,
43+
"no-empty-source": true,
44+
"selector-no-qualifying-type": true,
45+
"no-empty-first-line": true,
46+
"no-eol-whitespace": true
47+
}
48+
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"phpro/grumphp": "^1.3",
88
"magento/magento-coding-standard": "*",
99
"phpmd/phpmd": "^2",
10-
"squizlabs/php_codesniffer": ">=2.9.2 <4.0.0"
10+
"squizlabs/php_codesniffer": ">=2.9.2 <4.0.0",
11+
"space48/grumphp-stylelint-task": "^1.0"
1112
},
1213
"require-dev": {
1314
},

grumphp.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ grumphp:
3535
max_warnings: ~
3636
no_eslintrc: false
3737
quiet: false
38+
stylelint:
39+
bin: node_modules/.bin/stylelint
40+
triggered_by: [ css, scss, less ]
41+
allowed_paths:
42+
- /^app/
43+
extensions:
44+
- Space48\GrumPHPStylelintTask\Extension

script/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/.."
44

5-
npm install eslint --save-dev
5+
npm install eslint stylelint --save-dev
66

77
[ -f ./ruleset.xml ] || cp $DIR/ruleset.xml ./
88
[ -f ./phpmd.xml ] || cp $DIR/phpmd.xml ./
99
[ -f ./.eslint ] || cp $DIR/.eslintrc ./
10+
[ -f ./.stylelintrc ] || cp $DIR/.stylelintrc ./
1011
[ -f ./grumphp.yml ] || cp $DIR/grumphp.yml ./

0 commit comments

Comments
 (0)