Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tools: stricter no-undef eslint rule
By default eslint does not validate variables that are placed in a
typeof check. This caused a error that is fixed in this PR.
  • Loading branch information
BridgeAR committed Apr 11, 2018
commit de5f13166102cb8fb1650add08f1e2a37b80dfc8
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module.exports = {
'no-this-before-super': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-undef': ['error', { typeof: true }],
'no-undef-init': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function validateLen(len) {
let err;

if (!isInt32(len)) {
if (typeof value !== 'number') {
if (typeof len !== 'number') {
err = new ERR_INVALID_ARG_TYPE('len', 'number', len);
} else {
// TODO(BridgeAR): Improve this error message.
Expand Down