eslint-plugin-you-dont-need-momentjs
Version:
Check better alternatives you can use without momentjs
17 lines (15 loc) • 436 B
JavaScript
module.exports = function(context) {
return {
CallExpression: function(node) {
if (node.callee.type === 'Identifier' && node.callee.name === 'require') {
var arg = node.arguments[0];
if (arg && arg.type === 'Literal' && arg.value === 'moment') {
context.report(
node,
'Use date-fns or Native Date methods instead of moment.js'
);
}
}
},
};
};