@atlaskit/eslint-plugin-design-system 10.3.0 → 10.4.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.
Files changed (144) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -0
  3. package/constellation/index/usage.mdx +1 -0
  4. package/constellation/use-latest-xcss-syntax/usage.mdx +33 -0
  5. package/dist/cjs/presets/all.codegen.js +2 -1
  6. package/dist/cjs/presets/recommended.codegen.js +2 -1
  7. package/dist/cjs/rules/index.codegen.js +3 -1
  8. package/dist/cjs/rules/use-latest-xcss-syntax/index.js +35 -0
  9. package/dist/cjs/rules/use-latest-xcss-syntax/transformers/index.js +12 -0
  10. package/dist/cjs/rules/use-latest-xcss-syntax/transformers/style-property/index.js +105 -0
  11. package/dist/cjs/rules/use-latest-xcss-syntax/transformers/style-property/style-map.js +7 -0
  12. package/dist/cjs/rules/use-latest-xcss-syntax/transformers/style-property/supported.js +13 -0
  13. package/dist/cjs/rules/use-latest-xcss-syntax/utils/index.js +12 -0
  14. package/dist/cjs/rules/use-latest-xcss-syntax/utils/is-string-or-number.js +9 -0
  15. package/dist/cjs/rules/use-tokens-typography/transformers/style-object.js +11 -0
  16. package/dist/es2019/presets/all.codegen.js +2 -1
  17. package/dist/es2019/presets/recommended.codegen.js +2 -1
  18. package/dist/es2019/rules/index.codegen.js +3 -1
  19. package/dist/es2019/rules/use-latest-xcss-syntax/index.js +27 -0
  20. package/dist/es2019/rules/use-latest-xcss-syntax/transformers/index.js +1 -0
  21. package/dist/es2019/rules/use-latest-xcss-syntax/transformers/style-property/index.js +99 -0
  22. package/dist/es2019/rules/use-latest-xcss-syntax/transformers/style-property/style-map.js +1 -0
  23. package/dist/es2019/rules/use-latest-xcss-syntax/transformers/style-property/supported.js +7 -0
  24. package/dist/es2019/rules/use-latest-xcss-syntax/utils/index.js +1 -0
  25. package/dist/es2019/rules/use-latest-xcss-syntax/utils/is-string-or-number.js +3 -0
  26. package/dist/es2019/rules/use-tokens-typography/transformers/style-object.js +12 -1
  27. package/dist/esm/presets/all.codegen.js +2 -1
  28. package/dist/esm/presets/recommended.codegen.js +2 -1
  29. package/dist/esm/rules/index.codegen.js +3 -1
  30. package/dist/esm/rules/use-latest-xcss-syntax/index.js +29 -0
  31. package/dist/esm/rules/use-latest-xcss-syntax/transformers/index.js +1 -0
  32. package/dist/esm/rules/use-latest-xcss-syntax/transformers/style-property/index.js +95 -0
  33. package/dist/esm/rules/use-latest-xcss-syntax/transformers/style-property/style-map.js +1 -0
  34. package/dist/esm/rules/use-latest-xcss-syntax/transformers/style-property/supported.js +7 -0
  35. package/dist/esm/rules/use-latest-xcss-syntax/utils/index.js +1 -0
  36. package/dist/esm/rules/use-latest-xcss-syntax/utils/is-string-or-number.js +3 -0
  37. package/dist/esm/rules/use-tokens-typography/transformers/style-object.js +11 -0
  38. package/dist/types/ast-nodes/function-call.d.ts +1 -1
  39. package/dist/types/ast-nodes/jsx-attribute.d.ts +1 -1
  40. package/dist/types/ast-nodes/jsx-element.d.ts +1 -1
  41. package/dist/types/ast-nodes/object-entry.d.ts +1 -1
  42. package/dist/types/ast-nodes/object.d.ts +1 -1
  43. package/dist/types/ast-nodes/root.d.ts +1 -1
  44. package/dist/types/index.codegen.d.ts +2 -0
  45. package/dist/types/presets/all.codegen.d.ts +2 -1
  46. package/dist/types/presets/recommended.codegen.d.ts +2 -1
  47. package/dist/types/rules/ensure-design-token-usage/color.d.ts +1 -1
  48. package/dist/types/rules/ensure-design-token-usage/error-boundary.d.ts +1 -1
  49. package/dist/types/rules/ensure-design-token-usage/shape.d.ts +1 -1
  50. package/dist/types/rules/ensure-design-token-usage/spacing.d.ts +1 -1
  51. package/dist/types/rules/ensure-design-token-usage/utils.d.ts +2 -2
  52. package/dist/types/rules/index.codegen.d.ts +1 -0
  53. package/dist/types/rules/no-deprecated-apis/index.d.ts +2 -2
  54. package/dist/types/rules/no-deprecated-imports/index.d.ts +2 -2
  55. package/dist/types/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-add-event-listener.d.ts +1 -1
  56. package/dist/types/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-bind-all.d.ts +1 -1
  57. package/dist/types/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-bind.d.ts +1 -1
  58. package/dist/types/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-jsx-attribute.d.ts +1 -1
  59. package/dist/types/rules/no-direct-use-of-web-platform-drag-and-drop/shared/is-blocked-event-binding.d.ts +1 -1
  60. package/dist/types/rules/use-heading/transformers/common.d.ts +2 -2
  61. package/dist/types/rules/use-href-in-link-item/utils.d.ts +1 -1
  62. package/dist/types/rules/use-latest-xcss-syntax/index.d.ts +4 -0
  63. package/dist/types/rules/use-latest-xcss-syntax/transformers/index.d.ts +1 -0
  64. package/dist/types/rules/use-latest-xcss-syntax/transformers/style-property/index.d.ts +18 -0
  65. package/dist/types/rules/use-latest-xcss-syntax/transformers/style-property/style-map.d.ts +1 -0
  66. package/dist/types/rules/use-latest-xcss-syntax/transformers/style-property/supported.d.ts +6 -0
  67. package/dist/types/rules/use-latest-xcss-syntax/utils/index.d.ts +1 -0
  68. package/dist/types/rules/use-latest-xcss-syntax/utils/is-string-or-number.d.ts +1 -0
  69. package/dist/types/rules/use-primitives/transformers/compiled-styled/convert-jsx-call-site.d.ts +1 -1
  70. package/dist/types/rules/use-primitives/transformers/compiled-styled/convert-styled-component-call-to-jsx.d.ts +1 -1
  71. package/dist/types/rules/use-primitives/transformers/compiled-styled/find-valid-jsx-usage-to-transform.d.ts +1 -1
  72. package/dist/types/rules/use-primitives/transformers/compiled-styled/index.d.ts +2 -2
  73. package/dist/types/rules/use-primitives/transformers/emotion-css/index.d.ts +2 -2
  74. package/dist/types/rules/use-primitives/utils/convert-ast-object-expression-to-js-object.d.ts +1 -1
  75. package/dist/types/rules/use-primitives/utils/get-attribute-value-identifier.d.ts +1 -1
  76. package/dist/types/rules/use-primitives/utils/get-jsx-attribute-by-name.d.ts +1 -1
  77. package/dist/types/rules/use-primitives/utils/is-valid-css-properties-to-transform.d.ts +2 -2
  78. package/dist/types/rules/use-primitives/utils/update-jsx-attribute-by-name.d.ts +1 -1
  79. package/dist/types/rules/use-primitives/utils/validate-styles.d.ts +2 -2
  80. package/dist/types/rules/use-primitives-text/transformers/common.d.ts +2 -2
  81. package/dist/types/rules/use-tokens-space/transformers/style-property/index.d.ts +1 -1
  82. package/dist/types/rules/use-tokens-typography/config/index.d.ts +1 -1
  83. package/dist/types/rules/use-tokens-typography/error-boundary.d.ts +1 -1
  84. package/dist/types/rules/use-tokens-typography/transformers/style-object.d.ts +3 -3
  85. package/dist/types/rules/use-tokens-typography/utils.d.ts +1 -1
  86. package/dist/types/rules/use-visually-hidden/utils.d.ts +1 -1
  87. package/dist/types/rules/utils/create-no-exported-rule/check-if-supported-export.d.ts +1 -1
  88. package/dist/types/rules/utils/create-no-tagged-template-expression-rule/index.d.ts +1 -1
  89. package/dist/types/rules/utils/get-first-supported-import.d.ts +2 -2
  90. package/dist/types/rules/utils/is-elevation.d.ts +1 -1
  91. package/dist/types-ts4.5/ast-nodes/function-call.d.ts +1 -1
  92. package/dist/types-ts4.5/ast-nodes/jsx-attribute.d.ts +1 -1
  93. package/dist/types-ts4.5/ast-nodes/jsx-element.d.ts +1 -1
  94. package/dist/types-ts4.5/ast-nodes/object-entry.d.ts +1 -1
  95. package/dist/types-ts4.5/ast-nodes/object.d.ts +1 -1
  96. package/dist/types-ts4.5/ast-nodes/root.d.ts +1 -1
  97. package/dist/types-ts4.5/index.codegen.d.ts +2 -0
  98. package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -1
  99. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +2 -1
  100. package/dist/types-ts4.5/rules/ensure-design-token-usage/color.d.ts +1 -1
  101. package/dist/types-ts4.5/rules/ensure-design-token-usage/error-boundary.d.ts +1 -1
  102. package/dist/types-ts4.5/rules/ensure-design-token-usage/shape.d.ts +1 -1
  103. package/dist/types-ts4.5/rules/ensure-design-token-usage/spacing.d.ts +1 -1
  104. package/dist/types-ts4.5/rules/ensure-design-token-usage/utils.d.ts +2 -2
  105. package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -0
  106. package/dist/types-ts4.5/rules/no-deprecated-apis/index.d.ts +2 -2
  107. package/dist/types-ts4.5/rules/no-deprecated-imports/index.d.ts +2 -2
  108. package/dist/types-ts4.5/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-add-event-listener.d.ts +1 -1
  109. package/dist/types-ts4.5/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-bind-all.d.ts +1 -1
  110. package/dist/types-ts4.5/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-bind.d.ts +1 -1
  111. package/dist/types-ts4.5/rules/no-direct-use-of-web-platform-drag-and-drop/checks/is-blocked-jsx-attribute.d.ts +1 -1
  112. package/dist/types-ts4.5/rules/no-direct-use-of-web-platform-drag-and-drop/shared/is-blocked-event-binding.d.ts +1 -1
  113. package/dist/types-ts4.5/rules/use-heading/transformers/common.d.ts +2 -2
  114. package/dist/types-ts4.5/rules/use-href-in-link-item/utils.d.ts +1 -1
  115. package/dist/types-ts4.5/rules/use-latest-xcss-syntax/index.d.ts +4 -0
  116. package/dist/types-ts4.5/rules/use-latest-xcss-syntax/transformers/index.d.ts +1 -0
  117. package/dist/types-ts4.5/rules/use-latest-xcss-syntax/transformers/style-property/index.d.ts +18 -0
  118. package/dist/types-ts4.5/rules/use-latest-xcss-syntax/transformers/style-property/style-map.d.ts +1 -0
  119. package/dist/types-ts4.5/rules/use-latest-xcss-syntax/transformers/style-property/supported.d.ts +6 -0
  120. package/dist/types-ts4.5/rules/use-latest-xcss-syntax/utils/index.d.ts +1 -0
  121. package/dist/types-ts4.5/rules/use-latest-xcss-syntax/utils/is-string-or-number.d.ts +1 -0
  122. package/dist/types-ts4.5/rules/use-primitives/transformers/compiled-styled/convert-jsx-call-site.d.ts +1 -1
  123. package/dist/types-ts4.5/rules/use-primitives/transformers/compiled-styled/convert-styled-component-call-to-jsx.d.ts +1 -1
  124. package/dist/types-ts4.5/rules/use-primitives/transformers/compiled-styled/find-valid-jsx-usage-to-transform.d.ts +1 -1
  125. package/dist/types-ts4.5/rules/use-primitives/transformers/compiled-styled/index.d.ts +2 -2
  126. package/dist/types-ts4.5/rules/use-primitives/transformers/emotion-css/index.d.ts +2 -2
  127. package/dist/types-ts4.5/rules/use-primitives/utils/convert-ast-object-expression-to-js-object.d.ts +1 -1
  128. package/dist/types-ts4.5/rules/use-primitives/utils/get-attribute-value-identifier.d.ts +1 -1
  129. package/dist/types-ts4.5/rules/use-primitives/utils/get-jsx-attribute-by-name.d.ts +1 -1
  130. package/dist/types-ts4.5/rules/use-primitives/utils/is-valid-css-properties-to-transform.d.ts +2 -2
  131. package/dist/types-ts4.5/rules/use-primitives/utils/update-jsx-attribute-by-name.d.ts +1 -1
  132. package/dist/types-ts4.5/rules/use-primitives/utils/validate-styles.d.ts +2 -2
  133. package/dist/types-ts4.5/rules/use-primitives-text/transformers/common.d.ts +2 -2
  134. package/dist/types-ts4.5/rules/use-tokens-space/transformers/style-property/index.d.ts +1 -1
  135. package/dist/types-ts4.5/rules/use-tokens-typography/config/index.d.ts +1 -1
  136. package/dist/types-ts4.5/rules/use-tokens-typography/error-boundary.d.ts +1 -1
  137. package/dist/types-ts4.5/rules/use-tokens-typography/transformers/style-object.d.ts +3 -3
  138. package/dist/types-ts4.5/rules/use-tokens-typography/utils.d.ts +1 -1
  139. package/dist/types-ts4.5/rules/use-visually-hidden/utils.d.ts +1 -1
  140. package/dist/types-ts4.5/rules/utils/create-no-exported-rule/check-if-supported-export.d.ts +1 -1
  141. package/dist/types-ts4.5/rules/utils/create-no-tagged-template-expression-rule/index.d.ts +1 -1
  142. package/dist/types-ts4.5/rules/utils/get-first-supported-import.d.ts +2 -2
  143. package/dist/types-ts4.5/rules/utils/is-elevation.d.ts +1 -1
  144. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::9b934590b0ff7880e962fa4dd73bdb0b>>
3
+ * @codegen <<SignedSource::5eacfe26cc2ae11b81dfad5719b90959>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import consistentCssPropUsage from './consistent-css-prop-usage';
@@ -33,6 +33,7 @@ import useDrawerLabel from './use-drawer-label';
33
33
  import useHeading from './use-heading';
34
34
  import useHeadingLevelInSpotlightCard from './use-heading-level-in-spotlight-card';
35
35
  import useHrefInLinkItem from './use-href-in-link-item';
36
+ import useLatestXcssSyntax from './use-latest-xcss-syntax';
36
37
  import usePopupLabel from './use-popup-label';
37
38
  import usePrimitives from './use-primitives';
38
39
  import usePrimitivesText from './use-primitives-text';
@@ -70,6 +71,7 @@ export default {
70
71
  'use-heading': useHeading,
71
72
  'use-heading-level-in-spotlight-card': useHeadingLevelInSpotlightCard,
72
73
  'use-href-in-link-item': useHrefInLinkItem,
74
+ 'use-latest-xcss-syntax': useLatestXcssSyntax,
73
75
  'use-popup-label': usePopupLabel,
74
76
  'use-primitives': usePrimitives,
75
77
  'use-primitives-text': usePrimitivesText,
@@ -0,0 +1,29 @@
1
+ import { createLintRule } from '../utils/create-rule';
2
+ import { StyleProperty } from './transformers';
3
+ export var noRawSpacingValues = "Don't use non-token values in padding or margin. There is ongoing work to make this a TypeScript error. Once that happens, you will have to delete/refactor anyway. Atlassians: See https://go.atlassian.com/xcss-spacing for details.";
4
+ var rule = createLintRule({
5
+ meta: {
6
+ name: 'use-latest-xcss-syntax',
7
+ type: 'problem',
8
+ fixable: 'code',
9
+ hasSuggestions: false,
10
+ docs: {
11
+ description: 'Enforces usage of space design tokens rather than hard-coded values in xcss.',
12
+ recommended: true,
13
+ severity: 'warn'
14
+ },
15
+ messages: {
16
+ noRawSpacingValues: noRawSpacingValues
17
+ }
18
+ },
19
+ create: function create(context) {
20
+ return {
21
+ 'CallExpression[callee.name="xcss"] ObjectExpression Property': function CallExpressionCalleeNameXcssObjectExpressionProperty(node) {
22
+ return StyleProperty.lint(node, {
23
+ context: context
24
+ });
25
+ }
26
+ };
27
+ }
28
+ });
29
+ export default rule;
@@ -0,0 +1 @@
1
+ export { StyleProperty } from './style-property';
@@ -0,0 +1,95 @@
1
+ /* eslint-disable @repo/internal/react/require-jsdoc */
2
+
3
+ import { isNodeOfType } from 'eslint-codemod-utils';
4
+ import * as ast from '../../../../ast-nodes';
5
+ import { styleMap } from './style-map';
6
+ import supported from './supported';
7
+ var messageId = 'noRawSpacingValues';
8
+ export var StyleProperty = {
9
+ lint: function lint(node, _ref) {
10
+ var context = _ref.context;
11
+ var _StyleProperty$_check = StyleProperty._check(node, {
12
+ context: context
13
+ }),
14
+ success = _StyleProperty$_check.success,
15
+ ref = _StyleProperty$_check.ref;
16
+ if (!success) {
17
+ return;
18
+ }
19
+ context.report({
20
+ node: ref,
21
+ messageId: messageId
22
+ });
23
+ },
24
+ _check: function _check(node, _ref2) {
25
+ var context = _ref2.context;
26
+ if (!isNodeOfType(node, 'Property')) {
27
+ return {
28
+ success: false,
29
+ ref: undefined
30
+ };
31
+ }
32
+ var importDeclarations = ast.Root.findImportsByModule(context.sourceCode.ast.body, '@atlaskit/primitives');
33
+ var isXcssImported = importDeclarations.some(function (importDeclaration) {
34
+ return ast.Import.containsNamedSpecifier(importDeclaration, 'xcss');
35
+ });
36
+ if (!isXcssImported) {
37
+ return {
38
+ success: false,
39
+ ref: undefined
40
+ };
41
+ }
42
+
43
+ /**
44
+ * Currently, we support values like:
45
+ * ```
46
+ * xcss({
47
+ * margin: '8px', // value.type is Literal
48
+ * })
49
+ * ```
50
+ *
51
+ * More complex code, like:
52
+ * ```
53
+ * xcss({
54
+ * margin: condition ? 'space.100' : 'space.200',
55
+ * })
56
+ * ```
57
+ * is too difficult to lint
58
+ */
59
+ if (!isNodeOfType(node.value, 'Literal')) {
60
+ return {
61
+ success: false,
62
+ ref: undefined
63
+ };
64
+ }
65
+ var _ast$ObjectEntry$getP = ast.ObjectEntry.getProperty(node),
66
+ property = _ast$ObjectEntry$getP.value;
67
+
68
+ // Bail if the property is not `padding`, `margin`, etc
69
+ if (!property || !styleMap.includes(property)) {
70
+ return {
71
+ success: false,
72
+ ref: undefined
73
+ };
74
+ }
75
+ var value = ast.ObjectEntry.getValue(node);
76
+ if (typeof value !== 'string') {
77
+ return {
78
+ success: false,
79
+ ref: undefined
80
+ };
81
+ }
82
+
83
+ // There are valid values to ignore, such as tokens, or `margin: auto`
84
+ if (supported.values.ignore.includes(value)) {
85
+ return {
86
+ success: false,
87
+ ref: undefined
88
+ };
89
+ }
90
+ return {
91
+ success: true,
92
+ ref: node
93
+ };
94
+ }
95
+ };
@@ -0,0 +1 @@
1
+ export var styleMap = ['margin-block-end', 'margin-block-start', 'margin-block', 'margin-bottom', 'margin-inline-end', 'margin-inline-start', 'margin-inline', 'margin-left', 'margin-right', 'margin-top', 'padding-block-end', 'padding-block-start', 'padding-block', 'padding-bottom', 'padding-inline-end', 'padding-inline-start', 'padding-inline', 'padding-left', 'padding-right', 'padding-top', 'margin', 'marginBlock', 'marginBlockEnd', 'marginBlockStart', 'marginBottom', 'marginInline', 'marginInlineEnd', 'marginInlineStart', 'marginLeft', 'marginRight', 'marginTop', 'padding', 'paddingBlock', 'paddingBlockEnd', 'paddingBlockStart', 'paddingBottom', 'paddingInline', 'paddingInlineEnd', 'paddingInlineStart', 'paddingLeft', 'paddingRight', 'paddingTop'];
@@ -0,0 +1,7 @@
1
+ export default {
2
+ values: {
3
+ ignore: ['auto', 'initial', 'inherit', 'unset', 'revert', 'revert-layer',
4
+ // Currently the DST opinion is that 0 is valid. It doesn't need to be converted to `space.0`
5
+ '0', 'space.negative.025', 'space.negative.050', 'space.negative.075', 'space.negative.100', 'space.negative.150', 'space.negative.200', 'space.negative.250', 'space.negative.300', 'space.negative.400', 'space.025', 'space.050', 'space.075', 'space.100', 'space.150', 'space.200', 'space.250', 'space.300', 'space.400', 'space.500', 'space.600', 'space.800', 'space.1000']
6
+ }
7
+ };
@@ -0,0 +1 @@
1
+ export { isStringOrNumber } from './is-string-or-number';
@@ -0,0 +1,3 @@
1
+ export var isStringOrNumber = function isStringOrNumber(value) {
2
+ return typeof value === 'string' || typeof value === 'number';
3
+ };
@@ -38,6 +38,17 @@ export var StyleObject = {
38
38
  var fontWeightNode = ASTObject.getEntryByPropertyName(node, 'fontWeight');
39
39
  var fontWeightRaw = fontWeightNode && getValueForPropertyNode(fontWeightNode, context);
40
40
 
41
+ // If fontWeightRaw is a token we find the token name and treat it like a raw value for simplicity.
42
+ // e.g. token('font.weight.bold', '700') ends up as '700' after this if-block.
43
+ // That way the token matching logic still runs and the font weight declaration can be removed and re-added after the main font token.
44
+ if (fontWeightRaw && typeof fontWeightRaw === 'string' && fontWeightRaw.includes('font.weight.')) {
45
+ var _fontWeightRaw$match;
46
+ var fontWeightTokenSuffix = ((_fontWeightRaw$match = fontWeightRaw.match(/font\.weight\.(\w*)/)) === null || _fontWeightRaw$match === void 0 ? void 0 : _fontWeightRaw$match[1]) || 'regular'; // ${token('font.weight.bold', '700')} -> 'bold'
47
+ if (Object.keys(fontWeightMap).includes(fontWeightTokenSuffix)) {
48
+ fontWeightRaw = fontWeightMap[fontWeightTokenSuffix];
49
+ }
50
+ }
51
+
41
52
  // If no fontWeight value exists, default to 400 to avoid matching with a bolder token resulting in a visual change
42
53
  var fontWeightValue = fontWeightRaw && normaliseValue('fontWeight', fontWeightRaw) || defaultFontWeight;
43
54
  fontWeightValue = fontWeightValue.length === 3 ? fontWeightValue : fontWeightMap[fontWeightValue] || defaultFontWeight;
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { CallExpression, ObjectExpression } from 'eslint-codemod-utils';
2
+ import { type CallExpression, type ObjectExpression } from 'eslint-codemod-utils';
3
3
  export declare const FunctionCall: {
4
4
  getName(node: CallExpression): string | undefined;
5
5
  updateName(node: CallExpression, newName: string, fixer: Rule.RuleFixer): Rule.Fix;
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXAttribute } from 'eslint-codemod-utils';
2
+ import { type JSXAttribute } from 'eslint-codemod-utils';
3
3
  declare const HelperJSXAttribute: {
4
4
  getName(node: JSXAttribute): string;
5
5
  updateName(node: JSXAttribute, name: string, fixer: Rule.RuleFixer): Rule.Fix;
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXAttribute, JSXElement, JSXFragment, JSXSpreadAttribute } from 'eslint-codemod-utils';
2
+ import { type JSXAttribute, type JSXElement, type JSXFragment, type JSXSpreadAttribute } from 'eslint-codemod-utils';
3
3
  export declare const JSXElementHelper: {
4
4
  /**
5
5
  * Names of JSXElements can be any of:
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { Property, SpreadElement } from 'eslint-codemod-utils';
2
+ import { type Property, type SpreadElement } from 'eslint-codemod-utils';
3
3
  export declare const ObjectEntry: {
4
4
  getProperty(node: Property): {
5
5
  type: 'Identifier';
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { ObjectExpression, Property, SpreadElement } from 'eslint-codemod-utils';
2
+ import { type ObjectExpression, type Property, type SpreadElement } from 'eslint-codemod-utils';
3
3
  declare const ASTObjectExpression: {
4
4
  /**
5
5
  * Returns `true` if an object contains a property with the specified name, `false` otherwise.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { Rule } from 'eslint';
3
- import { Directive, ImportDeclaration, insertImportDeclaration, ModuleDeclaration, Statement } from 'eslint-codemod-utils';
3
+ import { type Directive, type ImportDeclaration, insertImportDeclaration, type ModuleDeclaration, type Statement } from 'eslint-codemod-utils';
4
4
  type ImportData = Parameters<typeof insertImportDeclaration>[1];
5
5
  export declare const Root: {
6
6
  /**
@@ -33,6 +33,7 @@ export declare const configs: {
33
33
  '@atlaskit/design-system/use-heading': string;
34
34
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': string;
35
35
  '@atlaskit/design-system/use-href-in-link-item': string;
36
+ '@atlaskit/design-system/use-latest-xcss-syntax': string;
36
37
  '@atlaskit/design-system/use-popup-label': string;
37
38
  '@atlaskit/design-system/use-primitives': string;
38
39
  '@atlaskit/design-system/use-primitives-text': string;
@@ -64,6 +65,7 @@ export declare const configs: {
64
65
  '@atlaskit/design-system/use-drawer-label': string;
65
66
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': string;
66
67
  '@atlaskit/design-system/use-href-in-link-item': string;
68
+ '@atlaskit/design-system/use-latest-xcss-syntax': string;
67
69
  '@atlaskit/design-system/use-popup-label': string;
68
70
  '@atlaskit/design-system/use-visually-hidden': string;
69
71
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::0be7639a95bf4c9bbfe00154d8193477>>
3
+ * @codegen <<SignedSource::8453f9be2d12c65323a70743b71f7474>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  declare const _default: {
@@ -36,6 +36,7 @@ declare const _default: {
36
36
  '@atlaskit/design-system/use-heading': string;
37
37
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': string;
38
38
  '@atlaskit/design-system/use-href-in-link-item': string;
39
+ '@atlaskit/design-system/use-latest-xcss-syntax': string;
39
40
  '@atlaskit/design-system/use-popup-label': string;
40
41
  '@atlaskit/design-system/use-primitives': string;
41
42
  '@atlaskit/design-system/use-primitives-text': string;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::73a3666b244b58cc221eebcda071161d>>
3
+ * @codegen <<SignedSource::c67c53656bcdaedb72953c8026a01c24>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  declare const _default: {
@@ -26,6 +26,7 @@ declare const _default: {
26
26
  '@atlaskit/design-system/use-drawer-label': string;
27
27
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': string;
28
28
  '@atlaskit/design-system/use-href-in-link-item': string;
29
+ '@atlaskit/design-system/use-latest-xcss-syntax': string;
29
30
  '@atlaskit/design-system/use-popup-label': string;
30
31
  '@atlaskit/design-system/use-visually-hidden': string;
31
32
  };
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { Property } from 'eslint-codemod-utils';
2
+ import { type Property } from 'eslint-codemod-utils';
3
3
  import { isLegacyElevation } from '../utils/is-elevation';
4
4
  import type { RuleConfig } from './types';
5
5
  type Suggestion = {
@@ -1,4 +1,4 @@
1
- import { RuleConfig } from './types';
1
+ import { type RuleConfig } from './types';
2
2
  /**
3
3
  * ESLint rules should NEVER throw exceptions, because that breaks the VSCode ESLint server
4
4
  * (and probably the IntelliJ one too), which causes linting to fail in a file.
@@ -1,4 +1,4 @@
1
- import { EslintNode } from 'eslint-codemod-utils';
1
+ import { type EslintNode } from 'eslint-codemod-utils';
2
2
  export declare const radiusValueToToken: any;
3
3
  export declare const borderWidthValueToToken: any;
4
4
  export declare function isRadiusProperty(propertyName: string): boolean;
@@ -1,4 +1,4 @@
1
1
  import type { Rule } from 'eslint';
2
- import { ImportDeclaration, Property } from 'eslint-codemod-utils';
2
+ import { type ImportDeclaration, type Property } from 'eslint-codemod-utils';
3
3
  import type { RuleConfig } from './types';
4
4
  export declare const lintObjectForSpacing: (node: Property, context: Rule.RuleContext, ruleConfig: RuleConfig, fontSize: any, tokenNode: ImportDeclaration | null) => void;
@@ -1,6 +1,6 @@
1
1
  import type { Rule } from 'eslint';
2
- import { EslintNode, ObjectExpression, Property, SpreadElement, TaggedTemplateExpression } from 'eslint-codemod-utils';
3
- import { Domains } from './types';
2
+ import { type EslintNode, type ObjectExpression, type Property, type SpreadElement, type TaggedTemplateExpression } from 'eslint-codemod-utils';
3
+ import { type Domains } from './types';
4
4
  export type ProcessedCSSLines = [string, string][];
5
5
  export declare function insertTokensImport(fixer: Rule.RuleFixer): Rule.Fix;
6
6
  export declare const isSpacingProperty: (propertyName: string) => boolean;
@@ -33,6 +33,7 @@ declare const _default: {
33
33
  'use-heading': import("eslint").Rule.RuleModule;
34
34
  'use-heading-level-in-spotlight-card': import("eslint").Rule.RuleModule;
35
35
  'use-href-in-link-item': import("eslint").Rule.RuleModule;
36
+ 'use-latest-xcss-syntax': import("eslint").Rule.RuleModule;
36
37
  'use-popup-label': import("eslint").Rule.RuleModule;
37
38
  'use-primitives': import("eslint").Rule.RuleModule;
38
39
  'use-primitives-text': import("eslint").Rule.RuleModule;
@@ -1,5 +1,5 @@
1
- import { TSESLint } from '@typescript-eslint/utils';
2
- import { DeprecatedConfig } from '../utils/types';
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ import { type DeprecatedConfig } from '../utils/types';
3
3
  export declare const noDeprecatedJSXAttributeMessageId = "noDeprecatedJSXAttributes";
4
4
  export declare const name = "no-deprecated-apis";
5
5
  declare const rule: TSESLint.RuleModule<string, [{
@@ -24,8 +24,8 @@
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
25
  * THE SOFTWARE.
26
26
  */
27
- import { TSESLint } from '@typescript-eslint/utils';
28
- import { DeprecatedConfig } from '../utils/types';
27
+ import { type TSESLint } from '@typescript-eslint/utils';
28
+ import { type DeprecatedConfig } from '../utils/types';
29
29
  export declare const name = "no-deprecated-imports";
30
30
  export declare const importNameWithCustomMessageId = "importNameWithCustomMessage";
31
31
  export declare const pathWithCustomMessageId = "pathWithCustomMessage";
@@ -1,2 +1,2 @@
1
- import { CallExpression } from 'eslint-codemod-utils';
1
+ import { type CallExpression } from 'eslint-codemod-utils';
2
2
  export declare function isBlockedAddEventListener(node: CallExpression): boolean;
@@ -1,3 +1,3 @@
1
1
  import type { Rule } from 'eslint';
2
- import { CallExpression } from 'eslint-codemod-utils';
2
+ import { type CallExpression } from 'eslint-codemod-utils';
3
3
  export declare function isBlockedBindAll(context: Rule.RuleContext, node: CallExpression): boolean;
@@ -1,3 +1,3 @@
1
1
  import type { Rule } from 'eslint';
2
- import { CallExpression } from 'eslint-codemod-utils';
2
+ import { type CallExpression } from 'eslint-codemod-utils';
3
3
  export declare function isBlockedBind(context: Rule.RuleContext, node: CallExpression): boolean;
@@ -1,3 +1,3 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXAttribute } from 'eslint-codemod-utils';
2
+ import { type JSXAttribute } from 'eslint-codemod-utils';
3
3
  export declare function isBlockedJSXAttribute(context: Rule.RuleContext, node: JSXAttribute): boolean;
@@ -1,2 +1,2 @@
1
- import { Property, SpreadElement } from 'eslint-codemod-utils';
1
+ import { type Property, type SpreadElement } from 'eslint-codemod-utils';
2
2
  export declare function isBlockedEventBinding(property: Property | SpreadElement): boolean;
@@ -1,6 +1,6 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXElement } from 'eslint-codemod-utils';
3
- import { RuleConfig } from '../config';
2
+ import { type JSXElement } from 'eslint-codemod-utils';
3
+ import { type RuleConfig } from '../config';
4
4
  export type MetaData = {
5
5
  context: Rule.RuleContext;
6
6
  config: RuleConfig;
@@ -1,5 +1,5 @@
1
1
  import type { Rule, Scope } from 'eslint';
2
- import { ImportDeclaration, JSXAttribute } from 'eslint-codemod-utils';
2
+ import { type ImportDeclaration, type JSXAttribute } from 'eslint-codemod-utils';
3
3
  export declare const hrefHasInvalidValue: (scope: Scope.Scope, href: JSXAttribute | undefined) => boolean;
4
4
  export declare const hasImportOfName: (node: ImportDeclaration, name: string) => boolean;
5
5
  export declare const insertButtonItemDefaultImport: (fixer: Rule.RuleFixer, node: ImportDeclaration) => Rule.Fix;
@@ -0,0 +1,4 @@
1
+ import type { Rule } from 'eslint';
2
+ export declare const noRawSpacingValues = "Don't use non-token values in padding or margin. There is ongoing work to make this a TypeScript error. Once that happens, you will have to delete/refactor anyway. Atlassians: See https://go.atlassian.com/xcss-spacing for details.";
3
+ declare const rule: Rule.RuleModule;
4
+ export default rule;
@@ -0,0 +1 @@
1
+ export { StyleProperty } from './style-property';
@@ -0,0 +1,18 @@
1
+ import type { Rule } from 'eslint';
2
+ import { type Property as ObjectEntry } from 'eslint-codemod-utils';
3
+ type Check = {
4
+ success: false;
5
+ ref: undefined;
6
+ } | {
7
+ success: true;
8
+ ref: ObjectEntry;
9
+ };
10
+ export declare const StyleProperty: {
11
+ lint(node: Rule.Node, { context }: {
12
+ context: Rule.RuleContext;
13
+ }): void;
14
+ _check(node: Rule.Node, { context }: {
15
+ context: Rule.RuleContext;
16
+ }): Check;
17
+ };
18
+ export {};
@@ -0,0 +1 @@
1
+ export declare const styleMap: string[];
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ values: {
3
+ ignore: string[];
4
+ };
5
+ };
6
+ export default _default;
@@ -0,0 +1 @@
1
+ export { isStringOrNumber } from './is-string-or-number';
@@ -0,0 +1 @@
1
+ export declare const isStringOrNumber: (value: string | number | bigint | true | RegExp | undefined) => value is string | number;
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXElement } from 'eslint-codemod-utils';
2
+ import { type JSXElement } from 'eslint-codemod-utils';
3
3
  /**
4
4
  * Transforms a JSXElement from:
5
5
  * ```
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { VariableDeclarator } from 'eslint-codemod-utils';
2
+ import { type VariableDeclarator } from 'eslint-codemod-utils';
3
3
  /**
4
4
  * Transforms a variable like:
5
5
  * ```
@@ -1,5 +1,5 @@
1
1
  import type { Rule, Scope } from 'eslint';
2
- import { JSXOpeningElement } from 'eslint-codemod-utils';
2
+ import { type JSXOpeningElement } from 'eslint-codemod-utils';
3
3
  /**
4
4
  * Given a component name finds its JSX usages and performs some
5
5
  * additional validations to ensure transformation can be done correctly
@@ -1,6 +1,6 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXElement, VariableDeclarator } from 'eslint-codemod-utils';
3
- import { RuleConfig } from '../../config';
2
+ import { type JSXElement, type VariableDeclarator } from 'eslint-codemod-utils';
3
+ import { type RuleConfig } from '../../config';
4
4
  interface MetaData {
5
5
  context: Rule.RuleContext;
6
6
  config: RuleConfig;
@@ -1,6 +1,6 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXElement } from 'eslint-codemod-utils';
3
- import { RuleConfig } from '../../config';
2
+ import { type JSXElement } from 'eslint-codemod-utils';
3
+ import { type RuleConfig } from '../../config';
4
4
  interface MetaData {
5
5
  context: Rule.RuleContext;
6
6
  config: RuleConfig;
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties } from 'react';
2
2
  import type { Rule } from 'eslint';
3
- import { ObjectExpression } from 'eslint-codemod-utils';
3
+ import { type ObjectExpression } from 'eslint-codemod-utils';
4
4
  export declare const SPREAD_SYNTAX: unique symbol;
5
5
  type Token = {
6
6
  tokenName: string;
@@ -1,4 +1,4 @@
1
- import { JSXAttribute } from 'eslint-codemod-utils';
1
+ import { type JSXAttribute } from 'eslint-codemod-utils';
2
2
  /**
3
3
  * Bit of a weird name, but the functionality is quite specific, so this is the best I could do.
4
4
  * This function looks at a JSXAttribute, and returns the string representation
@@ -1,2 +1,2 @@
1
- import { JSXAttribute, JSXOpeningElement } from 'eslint-codemod-utils';
1
+ import { type JSXAttribute, type JSXOpeningElement } from 'eslint-codemod-utils';
2
2
  export declare const getJSXAttributeByName: (node: JSXOpeningElement, attrName: string) => JSXAttribute | undefined;
@@ -1,4 +1,4 @@
1
1
  import type { Rule } from 'eslint';
2
- import { SimpleCallExpression } from 'eslint-codemod-utils';
3
- import { RuleConfig } from '../config';
2
+ import { type SimpleCallExpression } from 'eslint-codemod-utils';
3
+ import { type RuleConfig } from '../config';
4
4
  export declare const isValidCssPropertiesToTransform: (node: SimpleCallExpression & Rule.NodeParentExtension, config: RuleConfig) => boolean;
@@ -1,3 +1,3 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXElement } from 'eslint-codemod-utils';
2
+ import { type JSXElement } from 'eslint-codemod-utils';
3
3
  export declare const updateJSXAttributeByName: (oldName: string, newName: string, node: JSXElement, fixer: Rule.RuleFixer) => Rule.Fix | never[];
@@ -1,3 +1,3 @@
1
- import { CallExpression } from 'eslint-codemod-utils';
2
- import { RuleConfig } from '../config';
1
+ import { type CallExpression } from 'eslint-codemod-utils';
2
+ import { type RuleConfig } from '../config';
3
3
  export declare const validateStyles: (node: CallExpression, config: RuleConfig) => boolean;
@@ -1,6 +1,6 @@
1
1
  import type { Rule } from 'eslint';
2
- import { JSXElement } from 'eslint-codemod-utils';
3
- import { RuleConfig } from '../config';
2
+ import { type JSXElement } from 'eslint-codemod-utils';
3
+ import { type RuleConfig } from '../config';
4
4
  export type MetaData = {
5
5
  context: Rule.RuleContext;
6
6
  config: RuleConfig;
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { Property } from 'eslint-codemod-utils';
2
+ import { type Property } from 'eslint-codemod-utils';
3
3
  type Ref = {
4
4
  node: Property;
5
5
  token?: string;
@@ -1,4 +1,4 @@
1
- import { JSONSchema4 } from '@typescript-eslint/utils/dist/json-schema';
1
+ import { type JSONSchema4 } from '@typescript-eslint/utils/dist/json-schema';
2
2
  export type RuleConfig = {
3
3
  failSilently?: boolean;
4
4
  shouldEnforceFallbacks?: boolean;
@@ -1,4 +1,4 @@
1
- import { RuleConfig } from './config';
1
+ import { type RuleConfig } from './config';
2
2
  /**
3
3
  * ESLint rules should NEVER throw exceptions, because that breaks the VSCode ESLint server
4
4
  * (and probably the IntelliJ one too), which causes linting to fail in a file.
@@ -1,7 +1,7 @@
1
1
  import type { Rule } from 'eslint';
2
- import { ImportDeclaration, ObjectExpression, Property, StringableASTNode } from 'eslint-codemod-utils';
3
- import { RuleConfig } from '../config';
4
- import { TokenValueMap } from '../utils';
2
+ import { type ImportDeclaration, type ObjectExpression, type Property, type StringableASTNode } from 'eslint-codemod-utils';
3
+ import { type RuleConfig } from '../config';
4
+ import { type TokenValueMap } from '../utils';
5
5
  interface MetaData {
6
6
  context: Rule.RuleContext;
7
7
  config: RuleConfig;
@@ -1,5 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
- import { CallExpression, Directive, EslintNode, ImportDeclaration, ModuleDeclaration, Property, Statement, StringableASTNode } from 'eslint-codemod-utils';
2
+ import { type CallExpression, type Directive, type EslintNode, type ImportDeclaration, type ModuleDeclaration, type Property, type Statement, type StringableASTNode } from 'eslint-codemod-utils';
3
3
  export declare const typographyProperties: string[];
4
4
  export declare const isTypographyProperty: (propertyName: string) => boolean;
5
5
  export declare const isFontSize: (node: EslintNode) => node is CallExpression;
@@ -1,5 +1,5 @@
1
1
  import type { SourceCode } from 'eslint';
2
- import { ObjectExpression } from 'eslint-codemod-utils';
2
+ import { type ObjectExpression } from 'eslint-codemod-utils';
3
3
  declare const referenceObject: {
4
4
  width: string;
5
5
  height: string;