mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
24 lines
606 B
JavaScript
24 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'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|