Skip to content

Commit 80e4426

Browse files
committed
fix(feedback): wrong work with shared aliases
1 parent 9263a42 commit 80e4426

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

rules/public-api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ module.exports = {
3232
* @example
3333
* 'shared/ui/button' // Pass
3434
*/
35-
`**/shared/*(${FS_SEGMENTS_REG})/!(${FS_SEGMENTS_REG})`,
35+
`**/*shared/*(${FS_SEGMENTS_REG})/!(${FS_SEGMENTS_REG})`,
3636

3737
/**
3838
* Allow import from segments in shared
3939
* @example
4040
* 'shared/ui' // Pass
4141
*/
42-
`**/shared/*(${FS_SEGMENTS_REG})`,
42+
`**/*shared/*(${FS_SEGMENTS_REG})`,
4343

4444
/** allow global modules */
4545
`**/node_modules/**`

rules/public-api/index.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,14 @@ describe("PublicAPI import boundaries:", () => {
145145

146146
assert.strictEqual(report[0].errorCount, 4);
147147
});
148+
149+
it("should lint shared aliases without errors", async () => {
150+
const report = await eslint.lintText(`
151+
import { routeNames } from '@/shared/api/router';
152+
import { fetchRules } from '@shared/api/rules';
153+
`, { filePath: "src/pages/main/ui/index.js" });
154+
155+
assert.strictEqual(report[0].errorCount, 0);
156+
});
148157
});
149158
});

0 commit comments

Comments
 (0)