Skip to content

Commit e92e7f5

Browse files
authored
[heft-lint] Fix autofixer (#5171)
Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
1 parent de7fa96 commit e92e7f5

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-lint-plugin",
5+
"comment": "Fix the `--fix` argument when the file only contains fixable issues.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-lint-plugin"
10+
}

heft-plugins/heft-lint-plugin/src/Eslint.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ export class Eslint extends LinterBase<TEslint.ESLint.LintResult> {
178178

179179
const trimmedLintResults: TEslint.ESLint.LintResult[] = [];
180180
for (const lintResult of lintResults) {
181-
if (lintResult.messages.length > 0 || lintResult.warningCount > 0 || lintResult.errorCount > 0) {
181+
if (
182+
lintResult.messages.length > 0 ||
183+
lintResult.warningCount > 0 ||
184+
lintResult.errorCount > 0 ||
185+
fixMessages.length > 0
186+
) {
182187
trimmedLintResults.push(lintResult);
183188
}
184189
}

0 commit comments

Comments
 (0)