Skip to content

Commit

Permalink
feat: new segment - assets
Browse files Browse the repository at this point in the history
  • Loading branch information
js2me committed Dec 1, 2022
1 parent 3101c17 commit a9fc72b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rules/public-api/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ describe("PublicAPI import boundaries:", () => {
import { AuthAPI } from "shared/api/auth";
import { useGeo } from "shared/lib/hooks";
import { styles } from "shared/ui/styles";
import { lockSound } from "shared/assets";
import { CONNECT_ATTEMPTS } from "shared/config";
`, { filePath: "src/features/form/ui/index.js" });

Expand All @@ -138,16 +139,18 @@ describe("PublicAPI import boundaries:", () => {
import { Hex } from "shared/api/ui";
import { Form } from "shared/ui/lib";
import { AuthForm } from "shared/api/ui";
import { lockSound } from "shared/assets/ui";
import { model } from "shared/ui/model";
`, { filePath: "src/features/form/ui/index.js" });

assert.strictEqual(report[0].errorCount, 4);
assert.strictEqual(report[0].errorCount, 5);
});

it("should lint without errors", async () => {
const report = await eslint.lintText(`
import { FancyLabel } from "../../label";
import { model } from "../model";
import { lockSound } from "../assets";
`, { filePath: "src/shared/ui/button/index.js" });

assert.strictEqual(report[0].errorCount, 0);
Expand All @@ -172,6 +175,7 @@ describe("PublicAPI import boundaries:", () => {
import { FancyLabel } from 'shared/ui';
import { convertToken } from 'shared/lib';
import { CONNECT_ATTEMPTS } from "shared/config";
import { lockSound } from "shared/assets";
`, { filePath: "src/pages/main/ui/index.js" });

assert.strictEqual(report[0].errorCount, 0);
Expand All @@ -192,6 +196,7 @@ describe("PublicAPI import boundaries:", () => {
const report = await eslint.lintText(`
import { routeNames } from '@/shared/api/router';
import { fetchRules } from '@shared/api/rules';
import { lockSound } from "shared/assets/sounds";
`, { filePath: "src/pages/main/ui/index.js" });

assert.strictEqual(report[0].errorCount, 0);
Expand Down
1 change: 1 addition & 0 deletions utils/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const FS_SEGMENTS = [
"lib",
"api",
"config",
"assets"
];

const getLowerLayers = (layer) => FS_LAYERS.slice(FS_LAYERS.indexOf(layer) + 1);
Expand Down

0 comments on commit a9fc72b

Please sign in to comment.