add import linting + fix checks

This commit is contained in:
Felix Roos 2023-01-28 21:00:42 +01:00
parent ea2d8b2773
commit 902f722d4c
17 changed files with 317 additions and 173 deletions

View file

@ -47,7 +47,8 @@
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.0.1",
"remark-toc": "^8.0.1",
"tailwindcss": "^3.2.4"
"tailwindcss": "^3.2.4",
"canvas": "^2.11.0"
},
"devDependencies": {
"html-escaper": "^3.0.3"

View file

@ -40,7 +40,7 @@ export const ALGOLIA = {
apiKey: 'XXXXXXXXXX',
};
export type Sidebar = Record<typeof KNOWN_LANGUAGE_CODES[number], Record<string, { text: string; link: string }[]>>;
export type Sidebar = Record<(typeof KNOWN_LANGUAGE_CODES)[number], Record<string, { text: string; link: string }[]>>;
export const SIDEBAR: Sidebar = {
en: {
Tutorial: [

View file

@ -6,5 +6,5 @@ export const langPathRegex = /\/([a-z]{2}-?[A-Z]{0,2})\//;
export function getLanguageFromURL(pathname: string) {
const langCodeMatch = pathname.match(langPathRegex);
const langCode = langCodeMatch ? langCodeMatch[1] : 'en';
return langCode as typeof KNOWN_LANGUAGE_CODES[number];
return langCode as (typeof KNOWN_LANGUAGE_CODES)[number];
}