web: switch to eslint

This commit is contained in:
Jens Langhammer
2020-12-01 09:15:41 +01:00
parent a312ad2ad1
commit 0231bcf685
25 changed files with 1010 additions and 151 deletions

View File

@ -6,7 +6,7 @@ export class Client {
makeUrl(url: string[], query?: { [key: string]: string }): string {
let builtUrl = `/api/${VERSION}/${url.join("/")}/`;
if (query) {
let queryString = Object.keys(query)
const queryString = Object.keys(query)
.map((k) => encodeURIComponent(k) + "=" + encodeURIComponent(query[k]))
.join("&");
builtUrl += `?${queryString}`;
@ -20,10 +20,10 @@ export class Client {
.then((r) => {
if (r.status > 300) {
switch (r.status) {
case 404:
throw new NotFoundError(`URL ${finalUrl} not found`);
default:
throw new RequestError(r.statusText);
case 404:
throw new NotFoundError(`URL ${finalUrl} not found`);
default:
throw new RequestError(r.statusText);
}
}
return r;

View File

@ -21,7 +21,7 @@ export class Config {
tracesSampleRate: 1.0,
environment: config.error_reporting_environment,
});
console.debug(`passbook/config: Sentry enabled.`);
console.debug("passbook/config: Sentry enabled.");
}
return config;
});

View File

@ -0,0 +1,15 @@
export interface Policy {
pk: string;
name: string;
[key: string]: any;
}
export interface PolicyBinding {
pk: string;
policy: string,
policy_obj: Policy;
target: string;
enabled: boolean;
order: number;
timeout: number;
}