@atlaskit/eslint-plugin-platform 2.9.0 → 2.9.1
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 +7 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/rules/ensure-critical-dependency-resolutions/index.js +0 -1
- package/dist/cjs/rules/import/no-barrel-entry-imports/index.js +68 -16
- package/dist/cjs/rules/import/no-barrel-entry-jest-mock/index.js +42 -8
- package/dist/cjs/rules/import/shared/package-resolution.js +153 -8
- package/dist/cjs/rules/no-restricted-fedramp-imports/index.js +65 -0
- package/dist/cjs/rules/visit-example-type-import-required/index.js +1 -1
- package/dist/es2019/index.js +2 -0
- package/dist/es2019/rules/ensure-critical-dependency-resolutions/index.js +0 -1
- package/dist/es2019/rules/import/no-barrel-entry-imports/index.js +66 -17
- package/dist/es2019/rules/import/no-barrel-entry-jest-mock/index.js +43 -9
- package/dist/es2019/rules/import/shared/package-resolution.js +119 -4
- package/dist/es2019/rules/no-restricted-fedramp-imports/index.js +47 -0
- package/dist/es2019/rules/visit-example-type-import-required/index.js +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/rules/ensure-critical-dependency-resolutions/index.js +0 -1
- package/dist/esm/rules/import/no-barrel-entry-imports/index.js +69 -17
- package/dist/esm/rules/import/no-barrel-entry-jest-mock/index.js +43 -9
- package/dist/esm/rules/import/shared/package-resolution.js +151 -8
- package/dist/esm/rules/no-restricted-fedramp-imports/index.js +59 -0
- package/dist/esm/rules/visit-example-type-import-required/index.js +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/rules/import/shared/package-resolution.d.ts +25 -0
- package/dist/types/rules/no-restricted-fedramp-imports/index.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/rules/import/shared/package-resolution.d.ts +25 -0
- package/dist/types-ts4.5/rules/no-restricted-fedramp-imports/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -29,6 +29,7 @@ declare const rules: {
|
|
|
29
29
|
'no-direct-document-usage': import("eslint").Rule.RuleModule;
|
|
30
30
|
'no-set-immediate': import("eslint").Rule.RuleModule;
|
|
31
31
|
'prefer-crypto-random-uuid': import("eslint").Rule.RuleModule;
|
|
32
|
+
'no-restricted-fedramp-imports': import("eslint").Rule.RuleModule;
|
|
32
33
|
'no-barrel-entry-imports': import("eslint").Rule.RuleModule;
|
|
33
34
|
'no-barrel-entry-jest-mock': import("eslint").Rule.RuleModule;
|
|
34
35
|
'no-jest-mock-barrel-files': import("eslint").Rule.RuleModule;
|
|
@@ -72,6 +73,7 @@ declare const plugin: {
|
|
|
72
73
|
'no-direct-document-usage': import("eslint").Rule.RuleModule;
|
|
73
74
|
'no-set-immediate': import("eslint").Rule.RuleModule;
|
|
74
75
|
'prefer-crypto-random-uuid': import("eslint").Rule.RuleModule;
|
|
76
|
+
'no-restricted-fedramp-imports': import("eslint").Rule.RuleModule;
|
|
75
77
|
'no-barrel-entry-imports': import("eslint").Rule.RuleModule;
|
|
76
78
|
'no-barrel-entry-jest-mock': import("eslint").Rule.RuleModule;
|
|
77
79
|
'no-jest-mock-barrel-files': import("eslint").Rule.RuleModule;
|
|
@@ -16,10 +16,21 @@ export interface ExportMatchResult {
|
|
|
16
16
|
*/
|
|
17
17
|
entryPointExportName?: string;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Check whether a subpath export key (e.g. `"./checkbox-select"`) is kebab-case.
|
|
21
|
+
*
|
|
22
|
+
* A key is considered kebab-case when the portion after the leading `"./"` prefix
|
|
23
|
+
* consists only of lowercase letters, digits, hyphens, dots, and forward-slash
|
|
24
|
+
* separators — i.e. no uppercase letters, underscores, or camelCase humps.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isKebabCaseExportKey(key: string): boolean;
|
|
19
27
|
/**
|
|
20
28
|
* Find a matching export entry for a given source file path.
|
|
21
29
|
* Returns the export path (e.g., "./controllers/analytics") or null if not found.
|
|
22
30
|
*
|
|
31
|
+
* When multiple export paths resolve to the same source file **and** point to an
|
|
32
|
+
* entry-point file, kebab-case keys are preferred over other casing styles.
|
|
33
|
+
*
|
|
23
34
|
* When `fs` is provided, also checks entry-point wrapper files. If an export resolves
|
|
24
35
|
* to a file inside a recognized entry-points folder (entry-points, entrypoints, etc.),
|
|
25
36
|
* the wrapper is parsed to see if it re-exports from `sourceFilePath`.
|
|
@@ -34,6 +45,20 @@ export declare function findExportForSourceFile({ sourceFilePath, exportsMap, fs
|
|
|
34
45
|
fs?: FileSystem;
|
|
35
46
|
sourceExportName?: string;
|
|
36
47
|
}): ExportMatchResult | null;
|
|
48
|
+
/**
|
|
49
|
+
* When a symbol reaches the consumer through a barrel package that re-exports from
|
|
50
|
+
* `crossPackageName`, find a `package.json` export subpath of that barrel whose entry
|
|
51
|
+
* file directly re-exports the symbol from `crossPackageName` (named exports only).
|
|
52
|
+
*
|
|
53
|
+
* This enables rewriting imports to `@scope/barrel/subpath` instead of
|
|
54
|
+
* `@scope/cross-package/...` when the barrel exposes such a subpath (e.g. `@atlaskit/select/react-select`).
|
|
55
|
+
*/
|
|
56
|
+
export declare function findCrossPackageBridgeExportPath({ exportsMap, crossPackageName, exportedName, fs, }: {
|
|
57
|
+
exportsMap: Map<string, string>;
|
|
58
|
+
crossPackageName: string;
|
|
59
|
+
exportedName: string;
|
|
60
|
+
fs: FileSystem;
|
|
61
|
+
}): ExportMatchResult | null;
|
|
37
62
|
/**
|
|
38
63
|
* Extract the package name and subpath from an import specifier.
|
|
39
64
|
* Returns null if the import is not a scoped package import.
|
package/package.json
CHANGED