Skip to content

Commit

Permalink
chore(eslint-plugin): fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
adjsky committed Oct 31, 2024
1 parent d742d7f commit fec87d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions eslint-plugin/rules/must_use_result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const rule = ruleCreator({
},
type: "problem",
messages: {
mustUse:
"`Result` may be an `Err` variant, which should be handled.",
mustUse: "`Result` may be an `Err` variant, which should be handled.",
},
schema: [],
},
Expand Down
15 changes: 5 additions & 10 deletions eslint-plugin/rules/must_use_result_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,15 @@ tester.run("must-use-result", rule, {
},

{
name:
"return a sync result in an async function, await and assign it",
name: "return a sync result in an async function, await and assign it",
code: injectCode(`
const okResult = await asyncGetOk()
const errResult = await asyncGetErr()
`),
},

{
name:
"return an async result in an async function, await and assign it",
name: "return an async result in an async function, await and assign it",
code: injectCode(`
const okAsyncResult = await asyncGetAsyncOk()
const errAsyncResult = await asyncGetAsyncErr()
Expand All @@ -174,8 +172,7 @@ tester.run("must-use-result", rule, {
},

{
name:
"create results in an array expression, assigned to a variable",
name: "create results in an array expression, assigned to a variable",
code: injectCode(`
const _ = [ok(1), err(2), okAsync(3), errAsync(4)]
`),
Expand Down Expand Up @@ -222,8 +219,7 @@ tester.run("must-use-result", rule, {
},

{
name:
"do stuff with results in logical expressions and assign them",
name: "do stuff with results in logical expressions and assign them",
code: injectCode(`
let someBool = false
const _ = someBool ? ok(4) : err(2)
Expand Down Expand Up @@ -286,8 +282,7 @@ tester.run("must-use-result", rule, {
},

{
name:
"create a sync result using class constructor but don't assign it",
name: "create a sync result using class constructor but don't assign it",
code: injectCode(`
new Ok(5)
new Err(5)
Expand Down

0 comments on commit fec87d8

Please sign in to comment.