Skip to content

Commit 125cf8c

Browse files
Copilotjonrohan
andauthored
Upgrade stylelint to 16.20.0 and fix responsive-widths deprecation warning (#621)
* Initial plan for issue * Upgrade stylelint to 16.20.0 and fix responsive-widths deprecation warning Co-authored-by: jonrohan <[email protected]> * Create thin-terms-add.md --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jonrohan <[email protected]> Co-authored-by: Jon Rohan <[email protected]>
1 parent fa2d742 commit 125cf8c

File tree

4 files changed

+39
-31
lines changed

4 files changed

+39
-31
lines changed

.changeset/thin-terms-add.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/stylelint-config": patch
3+
---
4+
5+
The declarationValueIndex function moved from lib/utils/declarationValueIndex to lib/utils/nodeFieldIndices

package-lock.json

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"postcss-styled-syntax": "^0.7.0",
4848
"postcss-value-parser": "^4.0.2",
4949
"string.prototype.matchall": "^4.0.2",
50-
"stylelint": "^16.11.0",
50+
"stylelint": "^16.20.0",
5151
"stylelint-browser-compat": "^1.0.0-beta.140",
5252
"stylelint-config-standard": "^38.0.0",
5353
"stylelint-scss": "^6.2.0",

plugins/responsive-widths.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export default stylelint.createPlugin(ruleName, (enabled, options = {}, context)
6060
if (parseInt(valueUnit.number) > 320) {
6161
problems.push({
6262
index: declarationValueIndex(decl) + node.sourceIndex,
63+
endIndex: declarationValueIndex(decl) + node.sourceIndex + node.value.length,
6364
message: messages.rejected(node.value),
6465
})
6566
}
@@ -68,6 +69,7 @@ export default stylelint.createPlugin(ruleName, (enabled, options = {}, context)
6869
if (parseInt(valueUnit.number) > 100) {
6970
problems.push({
7071
index: declarationValueIndex(decl) + node.sourceIndex,
72+
endIndex: declarationValueIndex(decl) + node.sourceIndex + node.value.length,
7173
message: messages.rejected(node.value),
7274
})
7375
}
@@ -79,6 +81,7 @@ export default stylelint.createPlugin(ruleName, (enabled, options = {}, context)
7981
for (const err of problems) {
8082
stylelint.utils.report({
8183
index: err.index,
84+
endIndex: err.endIndex,
8285
message: err.message,
8386
node: decl,
8487
result,

0 commit comments

Comments
 (0)