From a0a1a4d139b6408419cd564611c26bd0dbade145 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Mon, 28 Nov 2022 13:58:14 +0100 Subject: enforce path aliases with eslint --- .eslintrc.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to '.eslintrc.json') diff --git a/.eslintrc.json b/.eslintrc.json index 111648c..0eb6689 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,8 +6,22 @@ "@typescript-eslint", "header", "simple-import-sort", - "unused-imports" + "unused-imports", + "path-alias" ], + "settings": { + "import/resolver": { + "alias": { + "map": [ + ["@webpack", "./src/webpack"], + ["@webpack/common", "./src/webpack/common"], + ["@utils", "./src/utils"], + ["@api", "./src/api"], + ["@components", "./src/components"] + ] + } + } + }, "rules": { // Since it's only been a month and Vencord has already been stolen // by random skids who rebranded it to "AlphaCord" and erased all license @@ -95,6 +109,8 @@ "unused-imports/no-unused-imports": "error", + "path-alias/no-relative": "error", + "@typescript-eslint/no-restricted-imports": [ "error", { -- cgit