|
2 | 2 | module.exports = {
|
3 | 3 | root: true,
|
4 | 4 | parser: "@typescript-eslint/parser",
|
5 |
| - plugins: ["@typescript-eslint", "prettier"], |
| 5 | + plugins: ["import", "@typescript-eslint", "prettier"], |
6 | 6 | extends: [
|
7 | 7 | "eslint:recommended",
|
| 8 | + "plugin:import/recommended", |
| 9 | + "plugin:import/typescript", |
8 | 10 | "plugin:@typescript-eslint/eslint-recommended",
|
9 | 11 | "plugin:@typescript-eslint/recommended",
|
10 | 12 | "prettier",
|
11 | 13 | ],
|
12 | 14 | parserOptions: {
|
13 | 15 | ecmaVersion: "latest",
|
14 | 16 | },
|
15 |
| - ignorePatterns: ["dist", "node_modules"], |
| 17 | + settings: { |
| 18 | + "import/resolver": { |
| 19 | + typescript: true, |
| 20 | + node: true, |
| 21 | + }, |
| 22 | + }, |
| 23 | + ignorePatterns: ["**/dist/*", "**/node_modules/*"], |
16 | 24 | rules: {
|
17 | 25 | "prettier/prettier": ["error"],
|
18 | 26 | // Fix annoying CRLF vs LF error.
|
19 | 27 | "linebreak-style": ["error", process.platform === "win32" ? "windows" : "unix"],
|
| 28 | + |
| 29 | + "import/no-restricted-paths": [ |
| 30 | + "error", |
| 31 | + { |
| 32 | + zones: [ |
| 33 | + { |
| 34 | + target: "apps/backend/", |
| 35 | + from: "apps/frontend/", |
| 36 | + message: "Backend should not import from frontend. Use hotel-management-shared instead.", |
| 37 | + }, |
| 38 | + { |
| 39 | + target: "apps/frontend/", |
| 40 | + from: "apps/backend/", |
| 41 | + message: "Frontend should not import from backend. Use hotel-management-shared instead.", |
| 42 | + }, |
| 43 | + ], |
| 44 | + }, |
| 45 | + ], |
20 | 46 | },
|
21 | 47 | overrides: [
|
22 | 48 | {
|
|
0 commit comments