@atlaskit/eslint-plugin-platform 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/rules/ensure-use-sync-external-store-server-snapshot/index.js +41 -0
- package/dist/cjs/rules/import/no-barrel-entry-imports/index.js +475 -67
- package/dist/cjs/rules/import/no-barrel-entry-jest-mock/index.js +387 -112
- package/dist/cjs/rules/import/no-jest-mock-barrel-files/index.js +3 -2
- package/dist/cjs/rules/import/no-relative-barrel-file-imports/index.js +7 -3
- package/dist/cjs/rules/import/shared/jest-utils.js +62 -9
- package/dist/cjs/rules/import/shared/package-resolution.js +156 -23
- package/dist/cjs/rules/visit-example-type-import-required/index.js +409 -0
- package/dist/es2019/index.js +6 -1
- package/dist/es2019/rules/ensure-use-sync-external-store-server-snapshot/index.js +43 -0
- package/dist/es2019/rules/import/no-barrel-entry-imports/index.js +372 -15
- package/dist/es2019/rules/import/no-barrel-entry-jest-mock/index.js +245 -17
- package/dist/es2019/rules/import/no-jest-mock-barrel-files/index.js +3 -2
- package/dist/es2019/rules/import/no-relative-barrel-file-imports/index.js +7 -3
- package/dist/es2019/rules/import/shared/jest-utils.js +44 -0
- package/dist/es2019/rules/import/shared/package-resolution.js +97 -5
- package/dist/es2019/rules/visit-example-type-import-required/index.js +375 -0
- package/dist/esm/index.js +6 -1
- package/dist/esm/rules/ensure-use-sync-external-store-server-snapshot/index.js +35 -0
- package/dist/esm/rules/import/no-barrel-entry-imports/index.js +475 -67
- package/dist/esm/rules/import/no-barrel-entry-jest-mock/index.js +388 -113
- package/dist/esm/rules/import/no-jest-mock-barrel-files/index.js +3 -2
- package/dist/esm/rules/import/no-relative-barrel-file-imports/index.js +7 -3
- package/dist/esm/rules/import/shared/jest-utils.js +61 -9
- package/dist/esm/rules/import/shared/package-resolution.js +156 -25
- package/dist/esm/rules/visit-example-type-import-required/index.js +402 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/rules/ensure-use-sync-external-store-server-snapshot/index.d.ts +3 -0
- package/dist/types/rules/import/shared/jest-utils.d.ts +8 -0
- package/dist/types/rules/import/shared/package-resolution.d.ts +22 -2
- package/dist/types/rules/visit-example-type-import-required/index.d.ts +4 -0
- package/dist/types-ts4.5/index.d.ts +12 -0
- package/dist/types-ts4.5/rules/ensure-use-sync-external-store-server-snapshot/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/import/shared/jest-utils.d.ts +8 -0
- package/dist/types-ts4.5/rules/import/shared/package-resolution.d.ts +22 -2
- package/dist/types-ts4.5/rules/visit-example-type-import-required/index.d.ts +4 -0
- package/package.json +3 -1
|
@@ -6,14 +6,34 @@ export declare function parsePackageExports({ packageDir, fs, }: {
|
|
|
6
6
|
packageDir: string;
|
|
7
7
|
fs: FileSystem;
|
|
8
8
|
}): Map<string, string>;
|
|
9
|
+
export interface ExportMatchResult {
|
|
10
|
+
exportPath: string;
|
|
11
|
+
/**
|
|
12
|
+
* When resolved through an entry-point wrapper, the name under which
|
|
13
|
+
* the symbol is exported from the entry-point file.
|
|
14
|
+
* Callers use this to override the barrel's `originalName` so the
|
|
15
|
+
* generated import matches the entry-point's export shape.
|
|
16
|
+
*/
|
|
17
|
+
entryPointExportName?: string;
|
|
18
|
+
}
|
|
9
19
|
/**
|
|
10
20
|
* Find a matching export entry for a given source file path.
|
|
11
21
|
* Returns the export path (e.g., "./controllers/analytics") or null if not found.
|
|
22
|
+
*
|
|
23
|
+
* When `fs` is provided, also checks entry-point wrapper files. If an export resolves
|
|
24
|
+
* to a file inside a recognized entry-points folder (entry-points, entrypoints, etc.),
|
|
25
|
+
* the wrapper is parsed to see if it re-exports from `sourceFilePath`.
|
|
26
|
+
*
|
|
27
|
+
* `sourceExportName` is the name under which the symbol is exported from the source file
|
|
28
|
+
* (e.g. `'default'`). Used to look up the corresponding entry-point export name so the
|
|
29
|
+
* caller can generate the correct import style.
|
|
12
30
|
*/
|
|
13
|
-
export declare function findExportForSourceFile({ sourceFilePath, exportsMap, }: {
|
|
31
|
+
export declare function findExportForSourceFile({ sourceFilePath, exportsMap, fs, sourceExportName, }: {
|
|
14
32
|
sourceFilePath: string;
|
|
15
33
|
exportsMap: Map<string, string>;
|
|
16
|
-
|
|
34
|
+
fs?: FileSystem;
|
|
35
|
+
sourceExportName?: string;
|
|
36
|
+
}): ExportMatchResult | null;
|
|
17
37
|
/**
|
|
18
38
|
* Extract the package name and subpath from an import specifier.
|
|
19
39
|
* Returns null if the import is not a scoped package import.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-platform",
|
|
3
3
|
"description": "The essential plugin for use with Atlassian frontend platform tools",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"atlassian": {
|
|
7
7
|
"team": "Build Infra",
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
"@compiled/eslint-plugin": "^0.18.2",
|
|
36
36
|
"@manypkg/find-root": "^1.1.0",
|
|
37
37
|
"@manypkg/get-packages": "^1.1.3",
|
|
38
|
+
"@typescript-eslint/typescript-estree": "^5.56.0",
|
|
39
|
+
"@typescript-eslint/utils": "^7.1.0",
|
|
38
40
|
"fuse.js": "^6.6.2",
|
|
39
41
|
"read-pkg-up": "^7.0.1",
|
|
40
42
|
"typescript": "5.9.2"
|