Fix linting for redux-devtools-core

This commit is contained in:
Zalmoxisus 2019-01-03 17:54:53 +02:00
parent edd397d7db
commit 4b9bcf55e6
2 changed files with 6 additions and 5 deletions

View File

@ -11,6 +11,7 @@
"react/jsx-uses-vars": 2, "react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2, "react/react-in-jsx-scope": 2,
"react/jsx-quotes": 0, "react/jsx-quotes": 0,
"arrow-parens": 0,
"block-scoped-var": 0, "block-scoped-var": 0,
"padded-blocks": 0, "padded-blocks": 0,
"quotes": [ 1, "single" ], "quotes": [ 1, "single" ],

View File

@ -35,21 +35,21 @@ export function getLocalFilter(config) {
} }
function getDevToolsOptions() { function getDevToolsOptions() {
return typeof window !== 'undefined' && window.devToolsOptions || {}; return (typeof window !== 'undefined' && window.devToolsOptions) || {};
} }
export function isFiltered(action, localFilter) { export function isFiltered(action, localFilter) {
const { type } = action.action || action; const { type } = action.action || action;
const opts = getDevToolsOptions(); const opts = getDevToolsOptions();
if ( if (
!localFilter && (opts.filter && opts.filter === FilterState.DO_NOT_FILTER) || (!localFilter && (opts.filter && opts.filter === FilterState.DO_NOT_FILTER)) ||
type && typeof type.match !== 'function' (type && typeof type.match !== 'function')
) return false; ) return false;
const { whitelist, blacklist } = localFilter || opts; const { whitelist, blacklist } = localFilter || opts;
return ( return (
whitelist && !type.match(whitelist) || (whitelist && !type.match(whitelist)) ||
blacklist && type.match(blacklist) (blacklist && type.match(blacklist))
); );
} }