Fix recoil lint rule

This commit is contained in:
Charles Bochet 2023-09-05 10:50:58 +02:00
parent 878302dd31
commit 53f3c1691d

View File

@ -18,7 +18,15 @@ module.exports = {
if (
node?.init?.callee?.name &&
typeof node.init.callee.name === "string" &&
node.init.callee.name.startsWith("useRecoil")
[
'useRecoilState',
'useRecoilFamilyState',
'useRecoilSelector',
'useRecoilScopedDate',
'useRecoilScopedFamilyState',
'useRecoilScopedSelector',
'useRecoilValue',
].includes(node.init.callee.name)
) {
const stateNameBase = node.init.arguments?.[0].name;