@mrhenry/stylelint-mrhenry-prop-order 3.0.20 → 3.1.1
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.mjs +22 -19
- package/order.mjs +1 -0
- package/package.json +3 -3
package/index.mjs
CHANGED
|
@@ -126,27 +126,30 @@ const ruleFunction = (primaryOption) => {
|
|
|
126
126
|
endIndex,
|
|
127
127
|
result: postcssResult,
|
|
128
128
|
ruleName,
|
|
129
|
-
fix:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
for (const [comment, prev] of matchedComments) {
|
|
143
|
-
if (!section.includes(prev)) {
|
|
144
|
-
continue;
|
|
129
|
+
fix: {
|
|
130
|
+
apply: () => {
|
|
131
|
+
sortedSection.reverse().forEach((decl) => {
|
|
132
|
+
container.insertBefore(firstNodeIndex, decl);
|
|
133
|
+
return;
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const finalFirstNode = container.nodes[firstNodeIndex];
|
|
137
|
+
if (originalFirstNode.raws.before && finalFirstNode.raws.before) {
|
|
138
|
+
const originalRawBefore = originalFirstNode.raws.before;
|
|
139
|
+
originalFirstNode.raws.before = finalFirstNode.raws.before;
|
|
140
|
+
finalFirstNode.raws.before = originalRawBefore;
|
|
145
141
|
}
|
|
146
142
|
|
|
147
|
-
comment
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
for (const [comment, prev] of matchedComments) {
|
|
144
|
+
if (!section.includes(prev)) {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
comment.remove();
|
|
149
|
+
container.insertAfter(prev, comment);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
node: container
|
|
150
153
|
}
|
|
151
154
|
});
|
|
152
155
|
|
package/order.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrhenry/stylelint-mrhenry-prop-order",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Mr. Henry's preferred order for CSS properties",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.mjs",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"stylelint-plugin"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"stylelint": "^16.
|
|
30
|
+
"stylelint": "^16.14.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"css-tree": "^3.1.0",
|
|
34
|
-
"stylelint": "^16.
|
|
34
|
+
"stylelint": "^16.14.1"
|
|
35
35
|
}
|
|
36
36
|
}
|