@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.
@@ -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
- export declare const createChecks: (context: Rule.RuleContext) => {
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
- export type iconMigrationError = Rule.ReportDescriptor;
4
- export type errorsListManual = {
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: iconMigrationError[];
11
+ errors: IconMigrationError[];
7
12
  iconName: string;
8
13
  importSource: string;
9
14
  };
10
15
  };
11
- export type errorsListAuto = {
12
- [loc: string]: iconMigrationError;
16
+ export type ErrorListAuto = {
17
+ [loc: string]: IconMigrationError;
13
18
  };
14
- export type guidanceList = {
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: errorsListManual) => void;
47
- export declare const createCantMigrateIdentifierError: (node: Node, packageName: string, exportName: string, errors: errorsListManual) => void;
48
- export declare const createCantFindSuitableReplacementError: (node: Node, importSource: string, iconName: string, errors: errorsListManual, sizeIssue?: boolean) => void;
49
- export declare const createCantMigrateFunctionUnknownError: (node: Node, importSource: string, iconName: string, errors: errorsListManual) => void;
50
- export declare const createCantMigrateColorError: (node: Node, colorValue: string, errors: errorsListManual, importSource: string, iconName: string) => void;
51
- export declare const createCantMigrateSpreadPropsError: (node: Node, missingProps: string[], errors: errorsListManual, importSource: string, iconName: string) => void;
52
- export declare const createCantMigrateSizeUnknown: (node: Node, errors: errorsListManual, importSource: string, iconName: string) => void;
53
- export declare const createAutoMigrationError: (node: Node, importSource: string, iconName: string, errors: errorsListAuto) => void;
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-design-system",
3
3
  "description": "The essential plugin for use with the Atlassian Design System.",
4
- "version": "10.12.3",
4
+ "version": "10.12.5",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {