-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EC505 avoid keep awake (react-native hook and function) #45
base: main
Are you sure you want to change the base?
EC505 avoid keep awake (react-native hook and function) #45
Conversation
Identifier(node) { | ||
if ( | ||
node?.name === "useKeepAwake" && | ||
node?.parent.type === "CallExpression" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could check that this method comes from expo-keep-awake
? This would prevent false positives if a developer uses this name in this JavaScript code
) { | ||
context.report({ node, messageId: "AvoidKeepAwake" }); | ||
} else if ( | ||
node?.name === "activateKeepAwake" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment for this method
|
||
```js | ||
export default function KeepAwakeExample() { | ||
useKeepAwake(); // Non compliant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you should also include the expo-keep-awake
dependency in exemple codes
No description provided.