Enforce null comparisons to make XO happy (#888)

* Remove react/no-eq-null rule from package.json

* Enforce null comparison and add type safety on checks
This commit is contained in:
David Gómez 2016-10-16 16:13:25 -04:00 committed by Leo Lamprecht
parent 235fcd03d4
commit 30a1a35937
2 changed files with 7 additions and 6 deletions

View file

@ -119,7 +119,8 @@ const reducer = (state = initial, action) => {
ret.borderColor = config.borderColor;
}
if (config.padding != null) {
if (typeof (config.padding) !== 'undefined' &&
config.padding !== null) {
ret.padding = config.padding;
}
@ -147,7 +148,8 @@ const reducer = (state = initial, action) => {
ret.bellSoundURL = config.bellSoundURL || initial.bellSoundURL;
}
if (config.copyOnSelect != null) {
if (typeof (config.copyOnSelect) !== 'undefined' &&
config.copyOnSelect !== null) {
ret.copyOnSelect = config.copyOnSelect;
}
@ -302,9 +304,9 @@ const reducer = (state = initial, action) => {
}
}
if (state.cols != null && state.rows != null &&
(state.rows !== state_.rows ||
state.cols !== state_.cols)) {
if ((typeof (state.cols) !== 'undefined' && state.cols !== null) &&
(typeof (state.rows) !== 'undefined' && state.rows !== null) &&
(state.rows !== state_.rows || state.cols !== state_.cols)) {
state_ = state_.merge({notifications: {resize: true}}, {deep: true});
}

View file

@ -62,7 +62,6 @@
],
"rules": {
"eqeqeq": ["error", "allow-null"],
"no-eq-null": 0,
"new-cap": 0,
"no-warning-comments": 0,
"complexity": 0,