webhook/node_modules/eslint-plugin-github/lib/rules/no-d-none.js
Joel Male 1ada95e04a
v2.0.0 (#12)
- Convert project to Javascript/Typescript
- Allow custom headers to be passed in (optional)
- Allow body to be optional
2020-08-26 10:52:47 +10:00

23 lines
606 B
JavaScript

module.exports = {
create(context) {
return {
CallExpression(node) {
if (
node.callee.type === 'MemberExpression' &&
node.callee.object.property &&
node.callee.object.property.name === 'classList'
) {
const invalidArgument = node.arguments.some(arg => {
return arg.type === 'Literal' && arg.value === 'd-none'
})
if (invalidArgument) {
context.report({
node,
message: 'Prefer hidden property to d-none class'
})
}
}
}
}
}
}