Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix report() for index/endIndex zero values #7565

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/red-fans-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `report()` for `index`/`endIndex` zero values
4 changes: 2 additions & 2 deletions lib/utils/report.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ function report(problem) {

if (problem.start) {
warningProperties.start = problem.start;
} else if (index) {
} else if (typeof index === 'number') {
warningProperties.index = index;
}

if (problem.end) {
warningProperties.end = problem.end;
} else if (endIndex) {
} else if (typeof endIndex === 'number') {
warningProperties.endIndex = endIndex;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/utils/report.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ export default function report(problem) {

if (problem.start) {
warningProperties.start = problem.start;
} else if (index) {
} else if (typeof index === 'number') {
warningProperties.index = index;
}

if (problem.end) {
warningProperties.end = problem.end;
} else if (endIndex) {
} else if (typeof endIndex === 'number') {
warningProperties.endIndex = endIndex;
}

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"micromatch": "^4.0.5",
"normalize-path": "^3.0.0",
"picocolors": "^1.0.0",
"postcss": "^8.4.35",
"postcss": "^8.4.38",
"postcss-resolve-nested-selector": "^0.1.1",
"postcss-safe-parser": "^7.0.0",
"postcss-selector-parser": "^6.0.16",
Expand Down
Loading