Swap to eslint (#154)

* 311 problems (173 errors, 138 warnings)

* Make a start...

* swap to react config

* Literally a handful left

* Clean.

* any removal

* Use Record

* Adjust versions

* Update with latest eslint-standard ruleset

* Update defaults.ts
This commit is contained in:
Jaco Greeff
2019-07-12 22:01:19 +02:00
committed by GitHub
parent 7b6a18cbfb
commit fd67ecdf3a
46 changed files with 412 additions and 395 deletions
@@ -10,20 +10,19 @@ import { BehaviorSubject } from 'rxjs';
import createOptionItem from '../options/item';
import development from './development';
function callNext (current: SubjectInfo, subject: BehaviorSubject<any>, withTest: boolean) {
function callNext (current: SubjectInfo, subject: BehaviorSubject<SubjectInfo>, withTest: boolean): void {
const isDevMode = development.isDevelopment();
const filtered: SubjectInfo = {};
subject.next(
Object.keys(current).reduce((filtered, key) => {
const { json: { meta: { isTesting = false } = {} } = {} } = current[key];
Object.keys(current).forEach((key): void => {
const { json: { meta: { isTesting = false } = {} } = {} } = current[key];
if (!withTest || isDevMode || isTesting !== true) {
filtered[key] = current[key];
}
if (!withTest || isDevMode || isTesting !== true) {
filtered[key] = current[key];
}
});
return filtered;
}, {} as SubjectInfo)
);
subject.next(filtered);
}
export default function genericSubject (keyCreator: (address: string) => string, withTest: boolean = false): AddressSubject {
@@ -56,7 +55,7 @@ export default function genericSubject (keyCreator: (address: string) => string,
return current[address];
},
remove: (store: KeyringStore, address: string) => {
remove: (store: KeyringStore, address: string): void => {
current = { ...current };
delete current[address];