@atlaskit/eslint-plugin-design-system 10.12.3 → 10.12.5
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 +16 -0
- package/dist/cjs/rules/no-legacy-icons/checks.js +100 -52
- package/dist/cjs/rules/no-legacy-icons/helpers.js +95 -22
- package/dist/cjs/rules/no-legacy-icons/index.js +5 -3
- package/dist/cjs/rules/no-legacy-icons/upcoming-icons.js +7 -0
- package/dist/es2019/rules/no-legacy-icons/checks.js +85 -41
- package/dist/es2019/rules/no-legacy-icons/helpers.js +80 -10
- package/dist/es2019/rules/no-legacy-icons/index.js +5 -3
- package/dist/es2019/rules/no-legacy-icons/upcoming-icons.js +1 -0
- package/dist/esm/rules/no-legacy-icons/checks.js +101 -53
- package/dist/esm/rules/no-legacy-icons/helpers.js +94 -21
- package/dist/esm/rules/no-legacy-icons/index.js +5 -3
- package/dist/esm/rules/no-legacy-icons/upcoming-icons.js +1 -0
- package/dist/types/rules/no-legacy-icons/checks.d.ts +4 -1
- package/dist/types/rules/no-legacy-icons/helpers.d.ts +25 -14
- package/dist/types/rules/no-legacy-icons/upcoming-icons.d.ts +1 -0
- package/dist/types-ts4.5/rules/no-legacy-icons/checks.d.ts +4 -1
- package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +25 -14
- package/dist/types-ts4.5/rules/no-legacy-icons/upcoming-icons.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
2
|
import { type CallExpression, type ExportDefaultDeclaration, type ExportNamedDeclaration, type Identifier, type ImportDeclaration, type VariableDeclaration } from 'eslint-codemod-utils';
|
|
3
|
-
|
|
3
|
+
type ReturnObject = {
|
|
4
4
|
checkImportDeclarations: (node: ImportDeclaration & Rule.NodeParentExtension) => void;
|
|
5
5
|
checkVariableDeclarations: (node: VariableDeclaration & Rule.NodeParentExtension) => void;
|
|
6
6
|
checkExportDefaultDeclaration: (node: ExportDefaultDeclaration & Rule.NodeParentExtension) => void;
|
|
7
7
|
checkExportNamedVariables: (node: ExportNamedDeclaration & Rule.NodeParentExtension) => void;
|
|
8
8
|
checkArrayOrMap: (node: Identifier) => void;
|
|
9
9
|
checkIconAsProp: (node: Identifier) => void;
|
|
10
|
+
checkIconReference: (node: Identifier & Rule.NodeParentExtension) => void;
|
|
10
11
|
checkJSXElement: (node: Rule.Node) => void;
|
|
11
12
|
checkCallExpression: (node: CallExpression & Rule.NodeParentExtension) => void;
|
|
12
13
|
throwErrors: () => void;
|
|
13
14
|
};
|
|
15
|
+
export declare const createChecks: (context: Rule.RuleContext) => ReturnObject;
|
|
16
|
+
export {};
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
2
|
import { type JSXAttribute, type Node } from 'eslint-codemod-utils';
|
|
3
|
-
|
|
4
|
-
export type
|
|
3
|
+
import { type IconMigrationSizeGuidance } from '@atlaskit/icon/UNSAFE_migration-map';
|
|
4
|
+
export type IconMigrationError = Rule.ReportDescriptor;
|
|
5
|
+
export type RangeList = {
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
}[];
|
|
9
|
+
export type ErrorListManual = {
|
|
5
10
|
[loc: string]: {
|
|
6
|
-
errors:
|
|
11
|
+
errors: IconMigrationError[];
|
|
7
12
|
iconName: string;
|
|
8
13
|
importSource: string;
|
|
9
14
|
};
|
|
10
15
|
};
|
|
11
|
-
export type
|
|
12
|
-
[loc: string]:
|
|
16
|
+
export type ErrorListAuto = {
|
|
17
|
+
[loc: string]: IconMigrationError;
|
|
13
18
|
};
|
|
14
|
-
export type
|
|
19
|
+
export type GuidanceList = {
|
|
15
20
|
[loc: string]: string;
|
|
16
21
|
};
|
|
17
22
|
declare const sizes: readonly [
|
|
@@ -28,6 +33,9 @@ export declare const isSize: (size: any) => size is "small" | "medium" | "large"
|
|
|
28
33
|
* @returns The migration map object for the legacy icon or null if not found
|
|
29
34
|
*/
|
|
30
35
|
export declare const getMigrationMapObject: (iconPackage: string) => any;
|
|
36
|
+
export declare const getUpcomingIcons: (iconPackage: string) => {
|
|
37
|
+
sizeGuidance: Record<Size, IconMigrationSizeGuidance>;
|
|
38
|
+
} | null;
|
|
31
39
|
/**
|
|
32
40
|
* Checks if a new icon can be auto-migrated based on guidance from the migration map
|
|
33
41
|
*/
|
|
@@ -43,14 +51,15 @@ export declare const createGuidance: (iconPackage: string, insideNewButton?: boo
|
|
|
43
51
|
*/
|
|
44
52
|
export declare const canMigrateColor: (color: string) => boolean;
|
|
45
53
|
export declare const locToString: (node: Node) => string;
|
|
46
|
-
export declare const createCantMigrateReExportError: (node: Node, packageName: string, exportName: string, errors:
|
|
47
|
-
export declare const
|
|
48
|
-
export declare const
|
|
49
|
-
export declare const
|
|
50
|
-
export declare const
|
|
51
|
-
export declare const
|
|
52
|
-
export declare const
|
|
53
|
-
export declare const
|
|
54
|
+
export declare const createCantMigrateReExportError: (node: Node, packageName: string, exportName: string, errors: ErrorListManual) => void;
|
|
55
|
+
export declare const createCantMigrateIdentifierMapOrArrayError: (node: Node, packageName: string, exportName: string, errors: ErrorListManual) => void;
|
|
56
|
+
export declare const createCantMigrateIdentifierError: (node: Node, packageName: string, exportName: string, errors: ErrorListManual) => void;
|
|
57
|
+
export declare const createCantFindSuitableReplacementError: (node: Node, importSource: string, iconName: string, errors: ErrorListManual, sizeIssue?: boolean) => void;
|
|
58
|
+
export declare const createCantMigrateFunctionUnknownError: (node: Node, importSource: string, iconName: string, errors: ErrorListManual) => void;
|
|
59
|
+
export declare const createCantMigrateColorError: (node: Node, colorValue: string, errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
60
|
+
export declare const createCantMigrateSpreadPropsError: (node: Node, missingProps: string[], errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
61
|
+
export declare const createCantMigrateSizeUnknown: (node: Node, errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
62
|
+
export declare const createAutoMigrationError: (node: Node, importSource: string, iconName: string, errors: ErrorListAuto) => void;
|
|
54
63
|
export declare const getLiteralStringValue: (value: any) => string | undefined;
|
|
55
64
|
export declare const createHelpers: (context: Rule.RuleContext) => {
|
|
56
65
|
/**
|
|
@@ -60,4 +69,6 @@ export declare const createHelpers: (context: Rule.RuleContext) => {
|
|
|
60
69
|
getTokenCallValue: (value: any) => string | undefined;
|
|
61
70
|
getConfigFlag: (key: string, defaultValue: boolean) => boolean;
|
|
62
71
|
};
|
|
72
|
+
export declare const addToListOfRanges: (node: Node, sortedListOfRangesForErrors: RangeList) => void;
|
|
73
|
+
export declare const isInRangeList: (node: Node, sortedListOfRangesForErrors: RangeList) => boolean;
|
|
63
74
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const upcomingIcons: string[];
|
package/package.json
CHANGED