0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools/eslint-rules/number-isnan.js
Jon Moss e554bc8f3f tools: add number-isnan rule
PR-URL: https://github.com/nodejs/node/pull/17556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-19 13:21:53 -05:00

15 lines
295 B
JavaScript

'use strict';
const astSelector = "CallExpression[callee.name='isNaN']";
const msg = 'Please use Number.isNaN instead of the global isNaN function';
module.exports = function(context) {
function report(node) {
context.report(node, msg);
}
return {
[astSelector]: report
};
};