web: update tsconfig strictness

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2023-01-01 23:44:15 +01:00
parent 1c1319927e
commit 475853fb14
No known key found for this signature in database
6 changed files with 16 additions and 3 deletions

View file

@ -12,7 +12,7 @@
"lit-analyse": "lit-analyzer src", "lit-analyse": "lit-analyzer src",
"prettier-check": "prettier --check .", "prettier-check": "prettier --check .",
"prettier": "prettier --write .", "prettier": "prettier --write .",
"tsc": "lingui compile && tsc --strict --noEmit", "tsc": "lingui compile && tsc --noEmit -p .",
"background-image": "npx @squoosh/cli -d src/assets/images --resize '{\"enabled\":true,\"width\":2560,\"method\":\"lanczos3\",\"fitMethod\":\"contain\",\"premultiply\":true,\"linearRGB\":true}' --mozjpeg '{\"quality\":75,\"baseline\":false,\"arithmetic\":false,\"progressive\":true,\"optimize_coding\":true,\"smoothing\":0,\"color_space\":3,\"quant_table\":3,\"trellis_multipass\":false,\"trellis_opt_zero\":false,\"trellis_opt_table\":false,\"trellis_loops\":1,\"auto_subsample\":true,\"chroma_subsample\":2,\"separate_chroma_quality\":false,\"chroma_quality\":75}' src/assets/images/flow_background.jpg" "background-image": "npx @squoosh/cli -d src/assets/images --resize '{\"enabled\":true,\"width\":2560,\"method\":\"lanczos3\",\"fitMethod\":\"contain\",\"premultiply\":true,\"linearRGB\":true}' --mozjpeg '{\"quality\":75,\"baseline\":false,\"arithmetic\":false,\"progressive\":true,\"optimize_coding\":true,\"smoothing\":0,\"color_space\":3,\"quant_table\":3,\"trellis_multipass\":false,\"trellis_opt_zero\":false,\"trellis_opt_table\":false,\"trellis_loops\":1,\"auto_subsample\":true,\"chroma_subsample\":2,\"separate_chroma_quality\":false,\"chroma_quality\":75}' src/assets/images/flow_background.jpg"
}, },
"lingui": { "lingui": {

View file

@ -108,12 +108,12 @@ export abstract class AKChart<T> extends AKElement {
const canvas = this.shadowRoot?.querySelector<HTMLCanvasElement>("canvas"); const canvas = this.shadowRoot?.querySelector<HTMLCanvasElement>("canvas");
if (!canvas) { if (!canvas) {
console.warn("Failed to get canvas element"); console.warn("Failed to get canvas element");
return false; return;
} }
const ctx = canvas.getContext("2d"); const ctx = canvas.getContext("2d");
if (!ctx) { if (!ctx) {
console.warn("failed to get 2d context"); console.warn("failed to get 2d context");
return false; return;
} }
this.chart = this.configureChart(r, ctx); this.chart = this.configureChart(r, ctx);
}); });

View file

@ -101,6 +101,7 @@ export class RouterOutlet extends AKElement {
console.debug("authentik/router: found match ", matchedRoute); console.debug("authentik/router: found match ", matchedRoute);
return true; return true;
} }
return false;
}); });
if (!matchedRoute) { if (!matchedRoute) {
console.debug(`authentik/router: route "${activeUrl}" not defined`); console.debug(`authentik/router: route "${activeUrl}" not defined`);

View file

@ -134,6 +134,7 @@ export class SidebarItem extends AKElement {
if (match !== null) { if (match !== null) {
return true; return true;
} }
return false;
}); });
} }

View file

@ -102,6 +102,7 @@ export class UserSettingsPage extends AKElement {
configureUrl=${ifDefined(pwStage[0].configureUrl)} configureUrl=${ifDefined(pwStage[0].configureUrl)}
></ak-user-settings-password>`; ></ak-user-settings-password>`;
} }
return html``;
}), }),
)} )}
</div> </div>

View file

@ -33,6 +33,16 @@
"DOM.Iterable", "DOM.Iterable",
"WebWorker" "WebWorker"
], ],
"noUnusedLocals": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
"noImplicitAny": true,
"plugins": [ "plugins": [
{ {
"name": "ts-lit-plugin", "name": "ts-lit-plugin",