UNPKG

@miovision/eslint-plugin-disallow-date

Version:

An ESLint plugin to disallow usage of JavaScript Date objects.

17 lines (15 loc) 361 B
/** * @fileoverview description * @author Ryan Skoblenick */ 'use strict'; 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.`); } }, }; };