eslint-plugin-use-storeon
Version:
[ESlint](https://eslint.org/) rules for [Storeon](https://github.com/storeon/storeon)
25 lines (21 loc) • 604 B
JavaScript
module.exports = {
create: function (context) {
return {
CallExpression (node) {
if (node.callee.name === 'useStoreon') {
const storeonVars = { dispatch: true }
node.arguments.forEach(n => { storeonVars[n.value] = true })
node.parent.id.properties.forEach(p => {
const { name } = p.key
if (!storeonVars[name]) {
context.report({
node: p,
message: 'useStoreon variables must have matching string passed in.'
})
}
})
}
}
}
}
}