mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-11-25 17:06:52 +01:00
23 lines
606 B
JavaScript
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'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|