Skip to content

Commit a372a43

Browse files
committed
refactor(fdd, lint): restrict imports rules
#163
1 parent 1be5993 commit a372a43

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.eslintrc.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,20 @@ const ALLOWED_PATH_GROUPS = ["shared", "shared/**", "pages", "features", "models
77
}),
88
);
99
/** Для запрета приватных путей */
10-
const DENIED_PATH_GROUPS = ["app/**", "pages/**", "features/**", "shared/*/**"];
10+
const DENIED_PATH_GROUPS = [
11+
// Private imports are prohibited, use public imports instead
12+
"app/**",
13+
"pages/**",
14+
"features/**",
15+
"shared/*/**",
16+
"models.gen",
17+
// Prefer absolute imports instead of relatives (for root modules)
18+
"../**/app",
19+
"../**/pages",
20+
"../**/features",
21+
"../**/shared",
22+
"../**/models",
23+
];
1124

1225
module.exports = {
1326
parser: "@typescript-eslint/parser",

src/.deploy/temp-stand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { CREDENTIAL_KEY } from "features/auth";
1+
import { Auth } from "features";
22

3+
const { CREDENTIAL_KEY } = Auth;
34
const tempStandRegex = /^(github-client-47c49|dev-github-client)--pr\d+.+\.web\.app$/;
45

56
const isTempStand = () => tempStandRegex.test(window.location.host);

src/models.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export * from "./models.gen";
1+
// Ему можно так импортить :D (он же прослойка)
2+
export * from "./models.gen"; // eslint-disable-line no-restricted-imports
23

34
/**
45
* Идентификационные данные для репозитория и его состояния

0 commit comments

Comments
 (0)