forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lint): don't mark plugin diagnostic as fixable, if it's not (deno…
…land#28147) A vector with fixes was always created, even if there were no applicable fixes.
- Loading branch information
1 parent
70d775c
commit 1f169f4
Showing
6 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"tempDir": true, | ||
"args": "lint a.ts", | ||
"output": "lint.out", | ||
"exitCode": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const _a = "foo"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lint": { | ||
"plugins": ["./plugin.ts"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[test-plugin/my-rule]: should be _b | ||
--> [WILDCARD]a.ts:1:7 | ||
| | ||
1 | const _a = "foo"; | ||
| ^^ | ||
|
||
|
||
Found 1 problem | ||
Checked 1 file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export default { | ||
name: "test-plugin", | ||
rules: { | ||
"my-rule": { | ||
create(context) { | ||
return { | ||
Identifier(node) { | ||
if (node.name === "_a") { | ||
context.report({ | ||
node, | ||
message: "should be _b", | ||
}); | ||
} | ||
}, | ||
}; | ||
}, | ||
}, | ||
}, | ||
}; |