@atlaskit/eslint-plugin-design-system 13.19.3 → 13.19.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.
Files changed (102) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/ast-nodes/import.js +1 -1
  3. package/dist/cjs/rules/enforce-inline-styles-in-select/utils.js +9 -2
  4. package/dist/cjs/rules/ensure-design-token-usage/utils.js +1 -1
  5. package/dist/cjs/rules/ensure-proper-xcss-usage/index.js +5 -3
  6. package/dist/cjs/rules/no-deprecated-imports/checks.js +2 -2
  7. package/dist/cjs/rules/no-html-anchor/node-types/jsx-element/index.js +1 -1
  8. package/dist/cjs/rules/no-html-code/node-types/jsx-element/index.js +1 -1
  9. package/dist/cjs/rules/no-invalid-css-map/utils.js +1 -0
  10. package/dist/cjs/rules/no-legacy-icons/checks.js +10 -8
  11. package/dist/cjs/rules/no-nested-styles/index.js +1 -1
  12. package/dist/cjs/rules/no-separator-with-list-elements/index.js +1 -1
  13. package/dist/cjs/rules/use-button-group-label/index.js +3 -2
  14. package/dist/cjs/rules/use-correct-field/index.js +2 -2
  15. package/dist/cjs/rules/use-cx-function-in-xcss/index.js +1 -1
  16. package/dist/cjs/rules/use-datetime-picker-calendar-button/index.js +7 -5
  17. package/dist/cjs/rules/use-menu-section-title/index.js +3 -2
  18. package/dist/cjs/rules/use-modal-dialog-close-button/index.js +43 -11
  19. package/dist/cjs/rules/use-onboarding-spotlight-label/index.js +3 -2
  20. package/dist/cjs/rules/use-should-render-to-parent/index.js +1 -1
  21. package/dist/cjs/rules/use-tokens-typography/transformers/style-object.js +1 -1
  22. package/dist/cjs/rules/use-visually-hidden/index.js +1 -1
  23. package/dist/cjs/rules/utils/create-no-exported-rule/is-styled-component.js +1 -1
  24. package/dist/cjs/rules/utils/get-import-name.js +2 -3
  25. package/dist/cjs/rules/utils/get-import-node-by-source.js +1 -1
  26. package/dist/es2019/ast-nodes/import.js +1 -1
  27. package/dist/es2019/rules/enforce-inline-styles-in-select/utils.js +9 -2
  28. package/dist/es2019/rules/ensure-design-token-usage/utils.js +1 -1
  29. package/dist/es2019/rules/ensure-proper-xcss-usage/index.js +5 -3
  30. package/dist/es2019/rules/no-deprecated-imports/checks.js +2 -2
  31. package/dist/es2019/rules/no-html-anchor/node-types/jsx-element/index.js +1 -1
  32. package/dist/es2019/rules/no-html-code/node-types/jsx-element/index.js +1 -1
  33. package/dist/es2019/rules/no-invalid-css-map/utils.js +1 -0
  34. package/dist/es2019/rules/no-legacy-icons/checks.js +10 -8
  35. package/dist/es2019/rules/no-nested-styles/index.js +1 -1
  36. package/dist/es2019/rules/no-separator-with-list-elements/index.js +1 -1
  37. package/dist/es2019/rules/use-button-group-label/index.js +3 -2
  38. package/dist/es2019/rules/use-correct-field/index.js +2 -2
  39. package/dist/es2019/rules/use-cx-function-in-xcss/index.js +1 -1
  40. package/dist/es2019/rules/use-datetime-picker-calendar-button/index.js +9 -7
  41. package/dist/es2019/rules/use-menu-section-title/index.js +3 -2
  42. package/dist/es2019/rules/use-modal-dialog-close-button/index.js +36 -10
  43. package/dist/es2019/rules/use-onboarding-spotlight-label/index.js +3 -2
  44. package/dist/es2019/rules/use-should-render-to-parent/index.js +1 -1
  45. package/dist/es2019/rules/use-tokens-typography/transformers/style-object.js +1 -1
  46. package/dist/es2019/rules/use-visually-hidden/index.js +1 -1
  47. package/dist/es2019/rules/utils/create-no-exported-rule/is-styled-component.js +1 -1
  48. package/dist/es2019/rules/utils/get-import-name.js +2 -3
  49. package/dist/es2019/rules/utils/get-import-node-by-source.js +1 -1
  50. package/dist/esm/ast-nodes/import.js +1 -1
  51. package/dist/esm/rules/enforce-inline-styles-in-select/utils.js +9 -2
  52. package/dist/esm/rules/ensure-design-token-usage/utils.js +1 -1
  53. package/dist/esm/rules/ensure-proper-xcss-usage/index.js +5 -3
  54. package/dist/esm/rules/no-deprecated-imports/checks.js +2 -2
  55. package/dist/esm/rules/no-html-anchor/node-types/jsx-element/index.js +1 -1
  56. package/dist/esm/rules/no-html-code/node-types/jsx-element/index.js +1 -1
  57. package/dist/esm/rules/no-invalid-css-map/utils.js +1 -0
  58. package/dist/esm/rules/no-legacy-icons/checks.js +10 -8
  59. package/dist/esm/rules/no-nested-styles/index.js +1 -1
  60. package/dist/esm/rules/no-separator-with-list-elements/index.js +1 -1
  61. package/dist/esm/rules/use-button-group-label/index.js +3 -2
  62. package/dist/esm/rules/use-correct-field/index.js +2 -2
  63. package/dist/esm/rules/use-cx-function-in-xcss/index.js +1 -1
  64. package/dist/esm/rules/use-datetime-picker-calendar-button/index.js +7 -5
  65. package/dist/esm/rules/use-menu-section-title/index.js +3 -2
  66. package/dist/esm/rules/use-modal-dialog-close-button/index.js +43 -11
  67. package/dist/esm/rules/use-onboarding-spotlight-label/index.js +3 -2
  68. package/dist/esm/rules/use-should-render-to-parent/index.js +1 -1
  69. package/dist/esm/rules/use-tokens-typography/transformers/style-object.js +1 -1
  70. package/dist/esm/rules/use-visually-hidden/index.js +1 -1
  71. package/dist/esm/rules/utils/create-no-exported-rule/is-styled-component.js +1 -1
  72. package/dist/esm/rules/utils/get-import-name.js +2 -3
  73. package/dist/esm/rules/utils/get-import-node-by-source.js +1 -1
  74. package/dist/types/ast-nodes/function-call.d.ts +2 -2
  75. package/dist/types/ast-nodes/jsx-attribute.d.ts +3 -3
  76. package/dist/types/ast-nodes/jsx-element.d.ts +1 -1
  77. package/dist/types/ast-nodes/object-entry.d.ts +2 -2
  78. package/dist/types/ast-nodes/object.d.ts +2 -2
  79. package/dist/types/ast-nodes/root.d.ts +0 -1
  80. package/dist/types/rules/no-legacy-icons/helpers.d.ts +12 -12
  81. package/dist/types/rules/use-primitives-text/transformers/paragraph-elements.d.ts +1 -1
  82. package/dist/types/rules/use-visually-hidden/utils.d.ts +1 -1
  83. package/dist/types/rules/utils/create-no-exported-rule/main.d.ts +1 -1
  84. package/dist/types/rules/utils/create-no-tagged-template-expression-rule/index.d.ts +1 -1
  85. package/dist/types/rules/utils/create-rule.d.ts +1 -1
  86. package/dist/types/rules/utils/get-is-exception.d.ts +1 -1
  87. package/dist/types/rules/utils/is-node.d.ts +2 -2
  88. package/dist/types-ts4.5/ast-nodes/function-call.d.ts +2 -2
  89. package/dist/types-ts4.5/ast-nodes/jsx-attribute.d.ts +3 -3
  90. package/dist/types-ts4.5/ast-nodes/jsx-element.d.ts +1 -1
  91. package/dist/types-ts4.5/ast-nodes/object-entry.d.ts +2 -2
  92. package/dist/types-ts4.5/ast-nodes/object.d.ts +2 -2
  93. package/dist/types-ts4.5/ast-nodes/root.d.ts +0 -1
  94. package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +12 -12
  95. package/dist/types-ts4.5/rules/use-primitives-text/transformers/paragraph-elements.d.ts +1 -1
  96. package/dist/types-ts4.5/rules/use-visually-hidden/utils.d.ts +1 -1
  97. package/dist/types-ts4.5/rules/utils/create-no-exported-rule/main.d.ts +1 -1
  98. package/dist/types-ts4.5/rules/utils/create-no-tagged-template-expression-rule/index.d.ts +1 -1
  99. package/dist/types-ts4.5/rules/utils/create-rule.d.ts +1 -1
  100. package/dist/types-ts4.5/rules/utils/get-is-exception.d.ts +1 -1
  101. package/dist/types-ts4.5/rules/utils/is-node.d.ts +2 -2
  102. package/package.json +5 -6
@@ -27,8 +27,9 @@ var rule = createLintRule({
27
27
  var buttonGroupIdentifier = (_node$specifiers = node.specifiers) === null || _node$specifiers === void 0 ? void 0 : _node$specifiers.filter(function (spec) {
28
28
  if (node.source.value === '@atlaskit/onboarding') {
29
29
  var _spec$imported;
30
- return spec.type === 'ImportSpecifier' && ((_spec$imported = spec.imported) === null || _spec$imported === void 0 ? void 0 : _spec$imported.name) === 'Spotlight';
31
- } else if (node.source.value === '@atlaskit/onboarding/spotlight') {
30
+ return spec.type === 'ImportSpecifier' && 'name' in spec.imported && ((_spec$imported = spec.imported) === null || _spec$imported === void 0 ? void 0 : _spec$imported.name) === 'Spotlight';
31
+ }
32
+ if (node.source.value === '@atlaskit/onboarding/spotlight') {
32
33
  return spec.type === 'ImportDefaultSpecifier';
33
34
  }
34
35
  });
@@ -48,7 +48,7 @@ var rule = createLintRule({
48
48
  if (defaultImport.length && defaultImport[0].local) {
49
49
  componentLocalName = defaultImport[0].local.name;
50
50
  // or if popup and using a named import
51
- } else if (namedImport.length && namedImport[0].type === 'ImportSpecifier' && namedImport[0].imported.name === 'Popup') {
51
+ } else if (namedImport.length && namedImport[0].type === 'ImportSpecifier' && 'name' in namedImport[0].imported && namedImport[0].imported.name === 'Popup') {
52
52
  componentLocalName = namedImport[0].local.name;
53
53
  }
54
54
  },
@@ -242,7 +242,7 @@ export var StyleObject = {
242
242
  if (!isNodeOfType(specifier, 'ImportSpecifier')) {
243
243
  return false;
244
244
  }
245
- if (specifier.imported.name === 'fontFallback') {
245
+ if ('name' in specifier.imported && specifier.imported.name === 'fontFallback') {
246
246
  return true;
247
247
  }
248
248
  return false;
@@ -34,7 +34,7 @@ var rule = createLintRule({
34
34
  var visuallyHiddenOrAssistive = node.specifiers.filter(function (specifier) {
35
35
  return specifier.type === 'ImportSpecifier';
36
36
  }).find(function (specifier) {
37
- return THEME_IMPORT_NAMES.includes(specifier.imported.name);
37
+ return 'name' in specifier.imported && THEME_IMPORT_NAMES.includes(specifier.imported.name);
38
38
  });
39
39
  if (!visuallyHiddenOrAssistive) {
40
40
  return;
@@ -45,7 +45,7 @@ var getStyledImportSpecifierName = function getStyledImportSpecifierName(context
45
45
  var _supportedImport$spec;
46
46
  var supportedImport = getFirstSupportedImport(context, importSources);
47
47
  return supportedImport === null || supportedImport === void 0 || (_supportedImport$spec = supportedImport.specifiers.find(function (spec) {
48
- return spec.type === 'ImportSpecifier' && spec.imported.name === 'styled' || spec.type === 'ImportDefaultSpecifier' && spec.local.name === 'styled';
48
+ return spec.type === 'ImportSpecifier' && 'name' in spec.imported && spec.imported.name === 'styled' || spec.type === 'ImportDefaultSpecifier' && spec.local.name === 'styled';
49
49
  })) === null || _supportedImport$spec === void 0 ? void 0 : _supportedImport$spec.local.name;
50
50
  };
51
51
 
@@ -9,7 +9,7 @@ export var getImportName = function getImportName(scope, packageName, componentN
9
9
  if (!def || !def.node || !isNodeOfType(def.node, 'ImportSpecifier') || !def.parent || !isNodeOfType(def.parent, 'ImportDeclaration')) {
10
10
  return;
11
11
  }
12
- return def.parent.source.value === packageName && def.node.imported.name === componentName;
12
+ return def.parent.source.value === packageName && 'name' in def.node.imported && def.node.imported.name === componentName;
13
13
  });
14
14
  if (matchedVariable) {
15
15
  break;
@@ -18,7 +18,6 @@ export var getImportName = function getImportName(scope, packageName, componentN
18
18
  }
19
19
  if (!matchedVariable) {
20
20
  return null;
21
- } else {
22
- return matchedVariable.defs[0].node.local.name;
23
21
  }
22
+ return matchedVariable.defs[0].node.local.name;
24
23
  };
@@ -37,7 +37,7 @@ export var getModuleOfIdentifier = function getModuleOfIdentifier(source, identi
37
37
  importName: identifierName
38
38
  };
39
39
  }
40
- if (spec.type === 'ImportSpecifier' && spec.local.name === identifierName) {
40
+ if (spec.type === 'ImportSpecifier' && 'name' in spec.imported && spec.local.name === identifierName) {
41
41
  return {
42
42
  moduleName: node.source.value + '',
43
43
  importName: spec.imported.name
@@ -12,10 +12,10 @@ export declare const FunctionCall: {
12
12
  * If you need to support another type of arg, add it, and update the type.
13
13
  */
14
14
  getArgumentAtPos(node: CallExpression, pos: number): {
15
- type: 'Literal';
15
+ type: "Literal";
16
16
  value: string;
17
17
  } | {
18
- type: 'ObjectExpression';
18
+ type: "ObjectExpression";
19
19
  value: ObjectExpression;
20
20
  } | undefined;
21
21
  };
@@ -16,13 +16,13 @@ declare const HelperJSXAttribute: {
16
16
  * If you need additional functionality add it, and set the correct `type` on the returned object
17
17
  */
18
18
  getValue(node: JSXAttribute): {
19
- type: 'ExpressionStatement';
19
+ type: "ExpressionStatement";
20
20
  value: string;
21
21
  } | {
22
- type: 'ExpressionStatement Literal';
22
+ type: "ExpressionStatement Literal";
23
23
  value: string | number | bigint | boolean | RegExp | null | undefined;
24
24
  } | {
25
- type: 'Literal';
25
+ type: "Literal";
26
26
  value: string;
27
27
  } | undefined;
28
28
  };
@@ -18,7 +18,7 @@ export declare const JSXElementHelper: {
18
18
  getAttributeByName(node: JSXElement, name: string): JSXAttribute | undefined;
19
19
  containsSpreadAttributes(node: JSXElement): boolean;
20
20
  addAttribute(node: JSXElement, name: string, value: string, fixer: Rule.RuleFixer): Rule.Fix;
21
- getChildren(node: JSXElement | JSXFragment): JSXElement['children'];
21
+ getChildren(node: JSXElement | JSXFragment): JSXElement["children"];
22
22
  hasAllowedAttrsOnly(node: JSXElement, allowedProps: string[]): boolean;
23
23
  };
24
24
  export { JSXElementHelper as JSXElement };
@@ -2,10 +2,10 @@ import type { Rule } from 'eslint';
2
2
  import { type Property, type SpreadElement } from 'eslint-codemod-utils';
3
3
  export declare const ObjectEntry: {
4
4
  getProperty(node: Property): {
5
- type: 'Identifier';
5
+ type: "Identifier";
6
6
  value: string;
7
7
  } | {
8
- type: 'Literal';
8
+ type: "Literal";
9
9
  value: string;
10
10
  } | {
11
11
  type: undefined;
@@ -22,7 +22,7 @@ declare const ASTObjectExpression: {
22
22
  * Returns only the property @type {Property['key']} like: `padding` from: `{ padding: '8px' }`.
23
23
  * If you want the key/value pair, use `getEntryByPropertyName`.
24
24
  */
25
- getProperty(node: ObjectExpression, name: string): Property['key'] | undefined;
25
+ getProperty(node: ObjectExpression, name: string): Property["key"] | undefined;
26
26
  /**
27
27
  * Gets the array of key/value pairs in an ObjectExpression.
28
28
  */
@@ -32,7 +32,7 @@ declare const ASTObjectExpression: {
32
32
  *
33
33
  * Values can be basically anything, so be careful with this.
34
34
  */
35
- getValueByPropertyName(node: ObjectExpression, name: string): Property['value'] | undefined;
35
+ getValueByPropertyName(node: ObjectExpression, name: string): Property["value"] | undefined;
36
36
  containsSpreadProps(node: ObjectExpression): boolean;
37
37
  updateValue(node: ObjectExpression, propertyName: string, newValue: string, fixer: Rule.RuleFixer): Rule.Fix;
38
38
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Rule } from 'eslint';
3
2
  import { type Directive, type ImportDeclaration, insertImportDeclaration, type ModuleDeclaration, type Statement } from 'eslint-codemod-utils';
4
3
  type ImportData = Parameters<typeof insertImportDeclaration>[1];
@@ -37,7 +37,7 @@ export type MigrationIconImportList = {
37
37
  };
38
38
  declare const sizes: readonly ["small", "medium", "large", "xlarge"];
39
39
  export type Size = (typeof sizes)[number];
40
- export declare const isSize: (size: any) => size is "small" | "medium" | "large" | "xlarge";
40
+ export declare const isSize: (size: any) => size is Size;
41
41
  /**
42
42
  * Returns the migration map object for a legacy icon or null if not found
43
43
  * @param iconPackage The name of the legacy icon package
@@ -48,14 +48,14 @@ export declare const getMigrationMapObject: (iconPackage: string) => {
48
48
  name: string;
49
49
  type: string;
50
50
  package: string;
51
- isMigrationUnsafe?: boolean | undefined;
52
- shouldForceSmallIcon?: boolean | undefined;
53
- } | undefined;
51
+ isMigrationUnsafe?: boolean;
52
+ shouldForceSmallIcon?: boolean;
53
+ };
54
54
  additionalIcons?: {
55
55
  name: string;
56
56
  type: string;
57
57
  package: string;
58
- }[] | undefined;
58
+ }[];
59
59
  sizeGuidance: Record<import("@atlaskit/icon").Size, IconMigrationSizeGuidance>;
60
60
  } | null;
61
61
  export declare const getUpcomingIcons: (iconPackage: string) => {
@@ -70,10 +70,10 @@ export declare const canAutoMigrateNewIconBasedOnSize: (guidance?: IconMigration
70
70
  */
71
71
  export declare const createGuidance: ({ iconPackage, insideNewButton, size: initialSize, shouldUseMigrationPath, shouldForceSmallIcon, }: {
72
72
  iconPackage: string;
73
- insideNewButton?: boolean | undefined;
74
- size?: "small" | "medium" | "large" | "xlarge" | undefined;
75
- shouldUseMigrationPath?: boolean | undefined;
76
- shouldForceSmallIcon?: boolean | undefined;
73
+ insideNewButton?: boolean;
74
+ size?: Size;
75
+ shouldUseMigrationPath?: boolean;
76
+ shouldForceSmallIcon?: boolean;
77
77
  }) => string;
78
78
  /**
79
79
  * Checks if the color can be migrated
@@ -95,9 +95,9 @@ export declare const createAutoMigrationError: ({ node, importSource, iconName,
95
95
  importSource: string;
96
96
  iconName: string;
97
97
  errors: ErrorListAuto;
98
- spacing?: string | undefined;
99
- insideNewButton?: boolean | undefined;
100
- shouldForceSmallIcon?: boolean | undefined;
98
+ spacing?: string;
99
+ insideNewButton?: boolean;
100
+ shouldForceSmallIcon?: boolean;
101
101
  }) => void;
102
102
  export declare const createHelpers: (ctx: Rule.RuleContext) => {
103
103
  /**
@@ -19,7 +19,7 @@ export declare const ParagraphElements: {
19
19
  _fixMultiple(node: JSXElement & {
20
20
  parent: Rule.Node;
21
21
  }, { context, config, refs }: MetaData & {
22
- refs: CheckResult['refs'];
22
+ refs: CheckResult["refs"];
23
23
  }): Rule.ReportFixer;
24
24
  };
25
25
  export {};
@@ -18,7 +18,7 @@ export type ReferenceObject = typeof referenceObject;
18
18
  /**
19
19
  * Returns the first import in the esprima AST.
20
20
  */
21
- export declare const getFirstImport: (source: SourceCode) => import("estree").ModuleDeclaration | import("estree").Statement | import("estree").Directive | undefined;
21
+ export declare const getFirstImport: (source: SourceCode) => import("estree").ImportDeclaration | undefined;
22
22
  /**
23
23
  * Takes a template literal and returns [key, value] array of the css properties
24
24
  */
@@ -15,5 +15,5 @@ type RuleModule = Rule.RuleModule;
15
15
  * @param messageId The ESLint error message to use for lint violations.
16
16
  * @returns An eslint rule.
17
17
  */
18
- export declare const createNoExportedRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule['create'];
18
+ export declare const createNoExportedRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule["create"];
19
19
  export {};
@@ -3,5 +3,5 @@ import type { JSONSchema4 } from 'json-schema';
3
3
  import { type SupportedNameChecker } from '@atlaskit/eslint-utils/is-supported-import';
4
4
  type RuleModule = Rule.RuleModule;
5
5
  export declare const noTaggedTemplateExpressionRuleSchema: JSONSchema4;
6
- export declare const createNoTaggedTemplateExpressionRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule['create'];
6
+ export declare const createNoTaggedTemplateExpressionRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule["create"];
7
7
  export {};
@@ -8,7 +8,7 @@ import { ESLintUtils } from '@typescript-eslint/utils';
8
8
  * @private
9
9
  * @deprecated
10
10
  */
11
- export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds>>) => ESLintUtils.RuleModule<MessageIds, Options, ESLintUtils.RuleListener>;
11
+ export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds>>) => ESLintUtils.RuleModule<MessageIds, Options>;
12
12
  /**
13
13
  * Tiny wrapped over the ESLint rule module type that ensures
14
14
  * there is a docs link to our ESLint plugin documentation page,
@@ -1,2 +1,2 @@
1
1
  import type { Rule } from 'eslint';
2
- export declare const getIsException: (exceptions?: string[]) => (node: Rule.Node) => boolean;
2
+ export declare const getIsException: (exceptions?: string[]) => ((node: Rule.Node) => boolean);
@@ -1,7 +1,7 @@
1
1
  import type { Rule, Scope } from 'eslint';
2
2
  import { type CallExpression, type EslintNode, type Expression, type TaggedTemplateExpression } from 'eslint-codemod-utils';
3
3
  export declare const isDecendantOfGlobalToken: (node: EslintNode) => boolean;
4
- export declare const isDecendantOfType: (node: Rule.Node, type: Rule.Node['type'], skipNode?: boolean) => boolean;
4
+ export declare const isDecendantOfType: (node: Rule.Node, type: Rule.Node["type"], skipNode?: boolean) => boolean;
5
5
  export declare const isPropertyKey: (node: Rule.Node) => boolean;
6
6
  export declare const isDecendantOfStyleJsxAttribute: (node: Rule.Node) => boolean;
7
7
  export declare const isDecendantOfSvgElement: (node: Rule.Node) => boolean;
@@ -11,4 +11,4 @@ export declare const isCssInJsCallNode: (node?: Expression | null) => node is Ca
11
11
  export declare const isCssInJsObjectNode: (node?: Expression | null) => node is CallExpression;
12
12
  export declare const isDecendantOfXcssBlock: (node: Rule.Node, referencesInScope: Scope.Reference[], importSources: string[]) => boolean;
13
13
  export declare const isDecendantOfStyleBlock: (node: Rule.Node) => boolean;
14
- export declare const isChildOfType: (node: Rule.Node, type: Rule.Node['type']) => boolean;
14
+ export declare const isChildOfType: (node: Rule.Node, type: Rule.Node["type"]) => boolean;
@@ -12,10 +12,10 @@ export declare const FunctionCall: {
12
12
  * If you need to support another type of arg, add it, and update the type.
13
13
  */
14
14
  getArgumentAtPos(node: CallExpression, pos: number): {
15
- type: 'Literal';
15
+ type: "Literal";
16
16
  value: string;
17
17
  } | {
18
- type: 'ObjectExpression';
18
+ type: "ObjectExpression";
19
19
  value: ObjectExpression;
20
20
  } | undefined;
21
21
  };
@@ -16,13 +16,13 @@ declare const HelperJSXAttribute: {
16
16
  * If you need additional functionality add it, and set the correct `type` on the returned object
17
17
  */
18
18
  getValue(node: JSXAttribute): {
19
- type: 'ExpressionStatement';
19
+ type: "ExpressionStatement";
20
20
  value: string;
21
21
  } | {
22
- type: 'ExpressionStatement Literal';
22
+ type: "ExpressionStatement Literal";
23
23
  value: string | number | bigint | boolean | RegExp | null | undefined;
24
24
  } | {
25
- type: 'Literal';
25
+ type: "Literal";
26
26
  value: string;
27
27
  } | undefined;
28
28
  };
@@ -18,7 +18,7 @@ export declare const JSXElementHelper: {
18
18
  getAttributeByName(node: JSXElement, name: string): JSXAttribute | undefined;
19
19
  containsSpreadAttributes(node: JSXElement): boolean;
20
20
  addAttribute(node: JSXElement, name: string, value: string, fixer: Rule.RuleFixer): Rule.Fix;
21
- getChildren(node: JSXElement | JSXFragment): JSXElement['children'];
21
+ getChildren(node: JSXElement | JSXFragment): JSXElement["children"];
22
22
  hasAllowedAttrsOnly(node: JSXElement, allowedProps: string[]): boolean;
23
23
  };
24
24
  export { JSXElementHelper as JSXElement };
@@ -2,10 +2,10 @@ import type { Rule } from 'eslint';
2
2
  import { type Property, type SpreadElement } from 'eslint-codemod-utils';
3
3
  export declare const ObjectEntry: {
4
4
  getProperty(node: Property): {
5
- type: 'Identifier';
5
+ type: "Identifier";
6
6
  value: string;
7
7
  } | {
8
- type: 'Literal';
8
+ type: "Literal";
9
9
  value: string;
10
10
  } | {
11
11
  type: undefined;
@@ -22,7 +22,7 @@ declare const ASTObjectExpression: {
22
22
  * Returns only the property @type {Property['key']} like: `padding` from: `{ padding: '8px' }`.
23
23
  * If you want the key/value pair, use `getEntryByPropertyName`.
24
24
  */
25
- getProperty(node: ObjectExpression, name: string): Property['key'] | undefined;
25
+ getProperty(node: ObjectExpression, name: string): Property["key"] | undefined;
26
26
  /**
27
27
  * Gets the array of key/value pairs in an ObjectExpression.
28
28
  */
@@ -32,7 +32,7 @@ declare const ASTObjectExpression: {
32
32
  *
33
33
  * Values can be basically anything, so be careful with this.
34
34
  */
35
- getValueByPropertyName(node: ObjectExpression, name: string): Property['value'] | undefined;
35
+ getValueByPropertyName(node: ObjectExpression, name: string): Property["value"] | undefined;
36
36
  containsSpreadProps(node: ObjectExpression): boolean;
37
37
  updateValue(node: ObjectExpression, propertyName: string, newValue: string, fixer: Rule.RuleFixer): Rule.Fix;
38
38
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Rule } from 'eslint';
3
2
  import { type Directive, type ImportDeclaration, insertImportDeclaration, type ModuleDeclaration, type Statement } from 'eslint-codemod-utils';
4
3
  type ImportData = Parameters<typeof insertImportDeclaration>[1];
@@ -42,7 +42,7 @@ declare const sizes: readonly [
42
42
  "xlarge"
43
43
  ];
44
44
  export type Size = (typeof sizes)[number];
45
- export declare const isSize: (size: any) => size is "small" | "medium" | "large" | "xlarge";
45
+ export declare const isSize: (size: any) => size is Size;
46
46
  /**
47
47
  * Returns the migration map object for a legacy icon or null if not found
48
48
  * @param iconPackage The name of the legacy icon package
@@ -53,14 +53,14 @@ export declare const getMigrationMapObject: (iconPackage: string) => {
53
53
  name: string;
54
54
  type: string;
55
55
  package: string;
56
- isMigrationUnsafe?: boolean | undefined;
57
- shouldForceSmallIcon?: boolean | undefined;
58
- } | undefined;
56
+ isMigrationUnsafe?: boolean;
57
+ shouldForceSmallIcon?: boolean;
58
+ };
59
59
  additionalIcons?: {
60
60
  name: string;
61
61
  type: string;
62
62
  package: string;
63
- }[] | undefined;
63
+ }[];
64
64
  sizeGuidance: Record<import("@atlaskit/icon").Size, IconMigrationSizeGuidance>;
65
65
  } | null;
66
66
  export declare const getUpcomingIcons: (iconPackage: string) => {
@@ -75,10 +75,10 @@ export declare const canAutoMigrateNewIconBasedOnSize: (guidance?: IconMigration
75
75
  */
76
76
  export declare const createGuidance: ({ iconPackage, insideNewButton, size: initialSize, shouldUseMigrationPath, shouldForceSmallIcon, }: {
77
77
  iconPackage: string;
78
- insideNewButton?: boolean | undefined;
79
- size?: "small" | "medium" | "large" | "xlarge" | undefined;
80
- shouldUseMigrationPath?: boolean | undefined;
81
- shouldForceSmallIcon?: boolean | undefined;
78
+ insideNewButton?: boolean;
79
+ size?: Size;
80
+ shouldUseMigrationPath?: boolean;
81
+ shouldForceSmallIcon?: boolean;
82
82
  }) => string;
83
83
  /**
84
84
  * Checks if the color can be migrated
@@ -100,9 +100,9 @@ export declare const createAutoMigrationError: ({ node, importSource, iconName,
100
100
  importSource: string;
101
101
  iconName: string;
102
102
  errors: ErrorListAuto;
103
- spacing?: string | undefined;
104
- insideNewButton?: boolean | undefined;
105
- shouldForceSmallIcon?: boolean | undefined;
103
+ spacing?: string;
104
+ insideNewButton?: boolean;
105
+ shouldForceSmallIcon?: boolean;
106
106
  }) => void;
107
107
  export declare const createHelpers: (ctx: Rule.RuleContext) => {
108
108
  /**
@@ -19,7 +19,7 @@ export declare const ParagraphElements: {
19
19
  _fixMultiple(node: JSXElement & {
20
20
  parent: Rule.Node;
21
21
  }, { context, config, refs }: MetaData & {
22
- refs: CheckResult['refs'];
22
+ refs: CheckResult["refs"];
23
23
  }): Rule.ReportFixer;
24
24
  };
25
25
  export {};
@@ -18,7 +18,7 @@ export type ReferenceObject = typeof referenceObject;
18
18
  /**
19
19
  * Returns the first import in the esprima AST.
20
20
  */
21
- export declare const getFirstImport: (source: SourceCode) => import("estree").ModuleDeclaration | import("estree").Statement | import("estree").Directive | undefined;
21
+ export declare const getFirstImport: (source: SourceCode) => import("estree").ImportDeclaration | undefined;
22
22
  /**
23
23
  * Takes a template literal and returns [key, value] array of the css properties
24
24
  */
@@ -15,5 +15,5 @@ type RuleModule = Rule.RuleModule;
15
15
  * @param messageId The ESLint error message to use for lint violations.
16
16
  * @returns An eslint rule.
17
17
  */
18
- export declare const createNoExportedRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule['create'];
18
+ export declare const createNoExportedRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule["create"];
19
19
  export {};
@@ -3,5 +3,5 @@ import type { JSONSchema4 } from 'json-schema';
3
3
  import { type SupportedNameChecker } from '@atlaskit/eslint-utils/is-supported-import';
4
4
  type RuleModule = Rule.RuleModule;
5
5
  export declare const noTaggedTemplateExpressionRuleSchema: JSONSchema4;
6
- export declare const createNoTaggedTemplateExpressionRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule['create'];
6
+ export declare const createNoTaggedTemplateExpressionRule: (isUsage: SupportedNameChecker, messageId: string) => RuleModule["create"];
7
7
  export {};
@@ -8,7 +8,7 @@ import { ESLintUtils } from '@typescript-eslint/utils';
8
8
  * @private
9
9
  * @deprecated
10
10
  */
11
- export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds>>) => ESLintUtils.RuleModule<MessageIds, Options, ESLintUtils.RuleListener>;
11
+ export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds>>) => ESLintUtils.RuleModule<MessageIds, Options>;
12
12
  /**
13
13
  * Tiny wrapped over the ESLint rule module type that ensures
14
14
  * there is a docs link to our ESLint plugin documentation page,
@@ -1,2 +1,2 @@
1
1
  import type { Rule } from 'eslint';
2
- export declare const getIsException: (exceptions?: string[]) => (node: Rule.Node) => boolean;
2
+ export declare const getIsException: (exceptions?: string[]) => ((node: Rule.Node) => boolean);
@@ -1,7 +1,7 @@
1
1
  import type { Rule, Scope } from 'eslint';
2
2
  import { type CallExpression, type EslintNode, type Expression, type TaggedTemplateExpression } from 'eslint-codemod-utils';
3
3
  export declare const isDecendantOfGlobalToken: (node: EslintNode) => boolean;
4
- export declare const isDecendantOfType: (node: Rule.Node, type: Rule.Node['type'], skipNode?: boolean) => boolean;
4
+ export declare const isDecendantOfType: (node: Rule.Node, type: Rule.Node["type"], skipNode?: boolean) => boolean;
5
5
  export declare const isPropertyKey: (node: Rule.Node) => boolean;
6
6
  export declare const isDecendantOfStyleJsxAttribute: (node: Rule.Node) => boolean;
7
7
  export declare const isDecendantOfSvgElement: (node: Rule.Node) => boolean;
@@ -11,4 +11,4 @@ export declare const isCssInJsCallNode: (node?: Expression | null) => node is Ca
11
11
  export declare const isCssInJsObjectNode: (node?: Expression | null) => node is CallExpression;
12
12
  export declare const isDecendantOfXcssBlock: (node: Rule.Node, referencesInScope: Scope.Reference[], importSources: string[]) => boolean;
13
13
  export declare const isDecendantOfStyleBlock: (node: Rule.Node) => boolean;
14
- export declare const isChildOfType: (node: Rule.Node, type: Rule.Node['type']) => boolean;
14
+ export declare const isChildOfType: (node: Rule.Node, type: Rule.Node["type"]) => boolean;
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": "13.19.3",
4
+ "version": "13.19.5",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@atlaskit/eslint-utils": "^2.0.0",
46
- "@atlaskit/icon": "^27.9.0",
47
- "@atlaskit/icon-lab": "^5.3.0",
46
+ "@atlaskit/icon": "^28.0.0",
47
+ "@atlaskit/icon-lab": "^5.6.0",
48
48
  "@atlaskit/tokens": "^6.0.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@typescript-eslint/utils": "^7.1.0",
@@ -73,10 +73,9 @@
73
73
  "@types/json-schema": "^7.0.15",
74
74
  "eslint": "^8.57.0",
75
75
  "jscodeshift": "^17.0.0",
76
- "outdent": "^0.5.0",
76
+ "outdent": "^0.7.1",
77
77
  "react": "^18.2.0",
78
- "ts-jest": "^29.2.2",
79
- "typescript": "~5.4.2"
78
+ "ts-jest": "^29.2.2"
80
79
  },
81
80
  "scripts": {
82
81
  "ak-postbuild": "cp -r configs dist",