Skip to content

Commit

Permalink
style: remove linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
FanchGadjo committed May 30, 2024
1 parent ceacfd3 commit cfec8cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
13 changes: 6 additions & 7 deletions eslint-plugin/lib/rules/avoid-keep-awake.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ module.exports = {
},
create: function (context) {
return {
Identifier(node){
Identifier(node) {
if (
node?.name === "useKeepAwake"
&& node?.parent.type === "CallExpression"
node?.name === "useKeepAwake" &&
node?.parent.type === "CallExpression"
) {
context.report({ node, messageId: "AvoidKeepAwake" });
}
else if (
node?.name === "activateKeepAwake"
&& node?.parent.type === "CallExpression"
} else if (
node?.name === "activateKeepAwake" &&
node?.parent.type === "CallExpression"
) {
context.report({ node, messageId: "AvoidKeepAwake" });
}
Expand Down
5 changes: 2 additions & 3 deletions eslint-plugin/tests/lib/rules/avoid-keep-awake.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ const ruleTester = new RuleTester({

const expectedErrorHook = {
messageId: "AvoidKeepAwake",
type: "Identifier",
type: "Identifier",
};

const expectedErrorFunction = {
messageId: "AvoidKeepAwake",
type: "Identifier",
type: "Identifier",
};

ruleTester.run("avoid-keep-awake", rule, {
Expand Down Expand Up @@ -80,7 +80,6 @@ ruleTester.run("avoid-keep-awake", rule, {
}
`,
},
,
],
invalid: [
{
Expand Down

0 comments on commit cfec8cd

Please sign in to comment.