Setup eslint and enforce rules
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-06-02 22:36:25 -05:00
parent 82e7a1f299
commit 1d5056b753
149 changed files with 6104 additions and 3114 deletions

View File

@@ -1,5 +1,5 @@
import {Canonical} from "./Canonical";
import {Singleton} from "../di";
import {Canonical} from './Canonical'
import {Singleton} from '../di'
/**
* Error throw when a duplicate canonical key is registered.
@@ -40,7 +40,9 @@ export class Canon {
* @return Canonical
*/
resource<T>(key: string): Canonical<T> {
if ( !this.resources[key] ) throw new NoSuchCanonicalResolverKeyError(key)
if ( !this.resources[key] ) {
throw new NoSuchCanonicalResolverKeyError(key)
}
return this.resources[key] as Canonical<T>
}
@@ -48,9 +50,11 @@ export class Canon {
* Register a canonical resource.
* @param {Canonical} unit
*/
registerCanonical(unit: Canonical<any>) {
registerCanonical(unit: Canonical<any>): void {
const key = unit.canonicalItems
if ( this.resources[key] ) throw new DuplicateResolverKeyError(key)
if ( this.resources[key] ) {
throw new DuplicateResolverKeyError(key)
}
this.resources[key] = unit
}
}