mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
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:
parent
235fcd03d4
commit
30a1a35937
2 changed files with 7 additions and 6 deletions
|
|
@ -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});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@
|
|||
],
|
||||
"rules": {
|
||||
"eqeqeq": ["error", "allow-null"],
|
||||
"no-eq-null": 0,
|
||||
"new-cap": 0,
|
||||
"no-warning-comments": 0,
|
||||
"complexity": 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue