Add EsLint

This commit is contained in:
2023-12-23 15:36:22 +01:00
parent 5a5cce199b
commit 8fcab610fb
22 changed files with 2215 additions and 468 deletions

View File

@ -17,21 +17,22 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { l as proxyL, t as proxyT } from 'astro-i18n'
import { l as proxyL } from "astro-i18n";
const locales = ["de"];
export const l = (route: string) => {
const transPath = proxyL(route)
const transPath = proxyL(route);
if(import.meta.env.DEV) {
return transPath;
}
let [empty, locale, ...rest] = transPath.split("/");
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, locale, ...rest] = transPath.split("/");
if (locales.includes(locale)) {
return "/" + rest.join("/");
}
return transPath;
}
};