Skip to content

Commit

Permalink
Add isNull and isUndefined (you-dont-need#183)
Browse files Browse the repository at this point in the history
* Add isNull and isUndefined.

* Fix rule count.
  • Loading branch information
ovidiubute authored and cht8687 committed May 2, 2019
1 parent 43615e1 commit 630f78d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/rules/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@
"alternative": "Number.isNaN()",
"ES6": true
},
"isNull": {
"ruleName": "is-null",
"compatible": true,
"alternative": "value === null"
},
"isUndefined": {
"ruleName": "is-undefined",
"compatible": true,
"alternative": "value === undefined"
},

"keys": {
"compatible": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');
const rules = require('../../../lib/rules/all');
const allRules = require('../../../lib/rules/rules');

assert.equal(Object.keys(allRules).length, 49, 'Don\'t miss a rule 😄');
assert.equal(Object.keys(allRules).length, 51, 'Don\'t miss a rule 😄');

const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 2018, sourceType: "module" }
Expand Down

0 comments on commit 630f78d

Please sign in to comment.