ESLint Unexpected use of isNaN
问题 I'm trying to use the isNaN global function inside an arrow function in a Node.js module but I'm getting this error: [eslint] Unexpected use of 'isNaN'. (no-restricted-globals) This is my code: const isNumber = value => !isNaN(parseFloat(value)); module.exports = { isNumber, }; Any idea on what am I doing wrong? PS: I'm using the AirBnB style guide. 回答1: As the documentation suggests, use Number.isNaN. const isNumber = value => !Number.isNaN(Number(value)); Quoting Airbnb's documentation: Why