@miovision/eslint-plugin-disallow-date
Version:
An ESLint plugin to disallow usage of JavaScript Date objects.
17 lines (15 loc) • 361 B
JavaScript
/**
* @fileoverview description
* @author Ryan Skoblenick
*/
;
module.exports = (context) => {
return {
'MemberExpression': (node) => {
if (node.property.type === 'Identifier' &&
node.property.name === 'toDate') {
context.report(node, `Usage of \`.${node.property.name}()\` is prohibited.`);
}
},
};
};