Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 610b83c

Browse files
committed
Move ruleURL call out of invalid point try block
On the off chance that ESLint feeds us something that is truthy that isn't a rule it could throw a `TypeError`, so move this out of the `try` block for invalid points.
1 parent c0c469f commit 610b83c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/helpers.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ export async function processESLintMessages(response, textEditor, showRule, work
240240
}
241241

242242
let ret
243+
244+
if (ruleId) {
245+
ret.url = ruleURI(ruleId).url
246+
}
247+
243248
let range
244249
try {
245250
if (eslintFullRange) {
@@ -258,10 +263,6 @@ export async function processESLintMessages(response, textEditor, showRule, work
258263
}
259264
}
260265

261-
if (ruleId) {
262-
ret.url = ruleURI(ruleId).url
263-
}
264-
265266
const ruleAppendix = showRule ? ` (${ruleId || 'Fatal'})` : ''
266267
ret.excerpt = `${message}${ruleAppendix}`
267268

0 commit comments

Comments
 (0)