Skip to content

Commit

Permalink
Add error for number constructor, too
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Mar 1, 2017
1 parent b9c96cf commit 2f63b0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eslint-rules/no-primitive-constructors.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ module.exports = function(context) {
'\'\' + value'
);
break;
case 'Number':
report(
node,
name,
'To cast a value to a number, use the plus operator: +value'
);
break;
}
}

Expand Down

0 comments on commit 2f63b0d

Please sign in to comment.