@penskemediacorp/stylelint-config 1.24.1 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +35 -24
- package/lib/custom-formatter.js +15 -12
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
2
|
+
rules: {
|
|
3
3
|
'block-opening-brace-space-before': 'always',
|
|
4
4
|
'declaration-block-no-shorthand-property-overrides': true,
|
|
5
5
|
'declaration-block-trailing-semicolon': 'always',
|
|
@@ -26,7 +26,7 @@ module.exports = {
|
|
|
26
26
|
'declaration-property-unit-disallowed-list': {
|
|
27
27
|
'font-size': [ 'em', 'px', 'pt' ],
|
|
28
28
|
'/^animation/': [ 's' ],
|
|
29
|
-
'/^transition/': [ 's' ]
|
|
29
|
+
'/^transition/': [ 's' ],
|
|
30
30
|
},
|
|
31
31
|
'declaration-block-single-line-max-declarations': 1,
|
|
32
32
|
'selector-max-attribute': 3,
|
|
@@ -47,39 +47,50 @@ module.exports = {
|
|
|
47
47
|
'declaration-colon-space-before': 'never',
|
|
48
48
|
'declaration-block-semicolon-newline-after': 'always',
|
|
49
49
|
'block-closing-brace-newline-after': [
|
|
50
|
-
'always',
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
'always',
|
|
51
|
+
{
|
|
52
|
+
ignoreAtRules: [ 'if', 'else' ],
|
|
53
|
+
},
|
|
53
54
|
],
|
|
54
55
|
'declaration-block-trailing-semicolon': 'always',
|
|
55
56
|
'block-opening-brace-newline-after': 'always-multi-line',
|
|
56
57
|
'selector-list-comma-newline-after': 'always',
|
|
57
58
|
'selector-combinator-space-after': 'always',
|
|
58
59
|
'selector-list-comma-space-after': 'always-single-line',
|
|
59
|
-
|
|
60
|
+
'selector-no-qualifying-type': true,
|
|
60
61
|
'comment-no-empty': true,
|
|
61
62
|
'at-rule-empty-line-before': [
|
|
62
|
-
'always',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
'always',
|
|
64
|
+
{
|
|
65
|
+
ignore: [
|
|
66
|
+
'after-comment',
|
|
67
|
+
'first-nested',
|
|
68
|
+
'blockless-after-blockless',
|
|
69
|
+
],
|
|
70
|
+
ignoreAtRules: [ 'else', 'import' ],
|
|
71
|
+
},
|
|
66
72
|
],
|
|
67
73
|
'rule-empty-line-before': [
|
|
68
|
-
'always-multi-line',
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
'always-multi-line',
|
|
75
|
+
{
|
|
76
|
+
ignore: [ 'first-nested', 'after-comment' ],
|
|
77
|
+
},
|
|
71
78
|
],
|
|
72
79
|
'unit-disallowed-list': [
|
|
73
|
-
'px',
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
'px',
|
|
81
|
+
{
|
|
82
|
+
ignoreProperties: {
|
|
83
|
+
px: [ 'box-shadow', '/^border/', 'transform', 'clip' ],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
'max-nesting-depth': [
|
|
88
|
+
2,
|
|
89
|
+
{
|
|
90
|
+
ignore: [ 'pseudo-classes' ],
|
|
91
|
+
ignoreAtRules: [ 'media', 'include' ],
|
|
92
|
+
},
|
|
78
93
|
],
|
|
79
|
-
'max-nesting-depth': [ 2, {
|
|
80
|
-
'ignore': [ 'pseudo-classes' ],
|
|
81
|
-
'ignoreAtRules': [ 'media', 'include' ]
|
|
82
|
-
} ],
|
|
83
94
|
'selector-nested-pattern': '^(?!&__|&--).*', // Disallow BEM concatenation - https://regex101.com/r/yZWeYK/3
|
|
84
|
-
}
|
|
85
|
-
};
|
|
95
|
+
},
|
|
96
|
+
};
|
package/lib/custom-formatter.js
CHANGED
|
@@ -2,27 +2,30 @@ const string = require( 'stylelint' ).formatters.string;
|
|
|
2
2
|
const fs = require( 'fs' );
|
|
3
3
|
const path = require( 'path' );
|
|
4
4
|
|
|
5
|
-
module.exports = function( results ) {
|
|
6
|
-
const styleLintPath = path.resolve(
|
|
5
|
+
module.exports = function ( results ) {
|
|
6
|
+
const styleLintPath = path.resolve(
|
|
7
|
+
`${ process.cwd() }/pmc.stylelintrc.json`
|
|
8
|
+
);
|
|
7
9
|
const additionalStyleLint = fs.existsSync( styleLintPath );
|
|
8
10
|
|
|
9
11
|
const propertiesForCustomMessage = JSON.parse(
|
|
10
12
|
fs.readFileSync( styleLintPath )
|
|
11
13
|
).messages;
|
|
12
14
|
|
|
13
|
-
results.forEach( error => {
|
|
14
|
-
error.warnings.forEach( x => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
results.forEach( ( error ) => {
|
|
16
|
+
error.warnings.forEach( ( x ) => {
|
|
17
|
+
const matchedMessage = propertiesForCustomMessage.filter(
|
|
18
|
+
( msg ) => {
|
|
19
|
+
const regex = new RegExp( msg.property );
|
|
20
|
+
return regex.test( x.text );
|
|
21
|
+
}
|
|
22
|
+
);
|
|
20
23
|
|
|
21
24
|
if ( matchedMessage.length ) {
|
|
22
|
-
x.text = matchedMessage[0].message;
|
|
25
|
+
x.text = matchedMessage[ 0 ].message;
|
|
23
26
|
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
27
|
+
} );
|
|
28
|
+
} );
|
|
26
29
|
|
|
27
30
|
return string( results );
|
|
28
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penskemediacorp/stylelint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Stylelint base config and customizations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stylelint",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"bugs": {
|
|
24
24
|
"url": "https://github.com/penske-media-corp/pmc-larva/issues"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "b9202e08f96e47041512b3b1a743c58f89b39152"
|
|
27
27
|
}
|