github-pages-deploy-action/node_modules/eslint-plugin-github/lib/rules/no-d-none.js

24 lines
606 B
JavaScript
Raw Normal View History

2020-03-07 11:45:40 +08:00
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'
})
}
}
}
}
}
}