@atlaskit/eslint-plugin-design-system 13.3.0 → 13.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 (70) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +1 -0
  3. package/dist/cjs/presets/all-flat.codegen.js +2 -1
  4. package/dist/cjs/presets/all.codegen.js +2 -1
  5. package/dist/cjs/presets/recommended-flat.codegen.js +2 -1
  6. package/dist/cjs/presets/recommended.codegen.js +2 -1
  7. package/dist/cjs/rules/ensure-design-token-usage/index.js +1 -0
  8. package/dist/cjs/rules/index.codegen.js +3 -1
  9. package/dist/cjs/rules/no-custom-icons/index.js +2 -0
  10. package/dist/cjs/rules/no-deprecated-apis/index.js +3 -1
  11. package/dist/cjs/rules/no-deprecated-imports/checks.js +3 -1
  12. package/dist/cjs/rules/no-legacy-icons/helpers.js +3 -1
  13. package/dist/cjs/rules/no-unsafe-design-token-usage/index.js +1 -0
  14. package/dist/cjs/rules/use-cx-function-in-xcss/index.js +97 -0
  15. package/dist/cjs/rules/use-heading/index.js +1 -0
  16. package/dist/cjs/rules/use-latest-xcss-syntax-typography/index.js +1 -0
  17. package/dist/cjs/rules/use-primitives/index.js +1 -0
  18. package/dist/cjs/rules/use-primitives-text/index.js +1 -0
  19. package/dist/cjs/rules/use-tokens-typography/index.js +1 -0
  20. package/dist/es2019/presets/all-flat.codegen.js +2 -1
  21. package/dist/es2019/presets/all.codegen.js +2 -1
  22. package/dist/es2019/presets/recommended-flat.codegen.js +2 -1
  23. package/dist/es2019/presets/recommended.codegen.js +2 -1
  24. package/dist/es2019/rules/ensure-design-token-usage/index.js +1 -0
  25. package/dist/es2019/rules/index.codegen.js +3 -1
  26. package/dist/es2019/rules/no-custom-icons/index.js +2 -0
  27. package/dist/es2019/rules/no-deprecated-apis/index.js +3 -1
  28. package/dist/es2019/rules/no-deprecated-imports/checks.js +3 -1
  29. package/dist/es2019/rules/no-legacy-icons/helpers.js +3 -1
  30. package/dist/es2019/rules/no-unsafe-design-token-usage/index.js +1 -0
  31. package/dist/es2019/rules/use-cx-function-in-xcss/index.js +70 -0
  32. package/dist/es2019/rules/use-heading/index.js +1 -0
  33. package/dist/es2019/rules/use-latest-xcss-syntax-typography/index.js +1 -0
  34. package/dist/es2019/rules/use-primitives/index.js +1 -0
  35. package/dist/es2019/rules/use-primitives-text/index.js +1 -0
  36. package/dist/es2019/rules/use-tokens-typography/index.js +1 -0
  37. package/dist/esm/presets/all-flat.codegen.js +2 -1
  38. package/dist/esm/presets/all.codegen.js +2 -1
  39. package/dist/esm/presets/recommended-flat.codegen.js +2 -1
  40. package/dist/esm/presets/recommended.codegen.js +2 -1
  41. package/dist/esm/rules/ensure-design-token-usage/index.js +1 -0
  42. package/dist/esm/rules/index.codegen.js +3 -1
  43. package/dist/esm/rules/no-custom-icons/index.js +2 -0
  44. package/dist/esm/rules/no-deprecated-apis/index.js +3 -1
  45. package/dist/esm/rules/no-deprecated-imports/checks.js +3 -1
  46. package/dist/esm/rules/no-legacy-icons/helpers.js +3 -1
  47. package/dist/esm/rules/no-unsafe-design-token-usage/index.js +1 -0
  48. package/dist/esm/rules/use-cx-function-in-xcss/index.js +91 -0
  49. package/dist/esm/rules/use-heading/index.js +1 -0
  50. package/dist/esm/rules/use-latest-xcss-syntax-typography/index.js +1 -0
  51. package/dist/esm/rules/use-primitives/index.js +1 -0
  52. package/dist/esm/rules/use-primitives-text/index.js +1 -0
  53. package/dist/esm/rules/use-tokens-typography/index.js +1 -0
  54. package/dist/types/index.codegen.d.ts +9 -0
  55. package/dist/types/presets/all-flat.codegen.d.ts +1 -0
  56. package/dist/types/presets/all.codegen.d.ts +1 -0
  57. package/dist/types/presets/recommended-flat.codegen.d.ts +1 -0
  58. package/dist/types/presets/recommended.codegen.d.ts +1 -0
  59. package/dist/types/rules/index.codegen.d.ts +1 -0
  60. package/dist/types/rules/no-legacy-icons/helpers.d.ts +1 -1
  61. package/dist/types/rules/use-cx-function-in-xcss/index.d.ts +3 -0
  62. package/dist/types-ts4.5/index.codegen.d.ts +9 -0
  63. package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +1 -0
  64. package/dist/types-ts4.5/presets/all.codegen.d.ts +1 -0
  65. package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +1 -0
  66. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -0
  67. package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -0
  68. package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +1 -1
  69. package/dist/types-ts4.5/rules/use-cx-function-in-xcss/index.d.ts +3 -0
  70. package/package.json +4 -4
@@ -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::29cc321a798c65c8464afd9e46366540>>
3
+ * @codegen <<SignedSource::96ec2e315f96de68a6448317cce334ce>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -38,6 +38,7 @@ export default {
38
38
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
39
39
  '@atlaskit/design-system/prefer-primitives': 'warn',
40
40
  '@atlaskit/design-system/use-button-group-label': 'warn',
41
+ '@atlaskit/design-system/use-cx-function-in-xcss': 'error',
41
42
  '@atlaskit/design-system/use-datetime-picker-calendar-button': 'warn',
42
43
  '@atlaskit/design-system/use-drawer-label': 'warn',
43
44
  '@atlaskit/design-system/use-heading': 'warn',
@@ -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::76f6f7b7602ea240cbcfc6bc98a781af>>
3
+ * @codegen <<SignedSource::4f6ee2ae56e1c0534f0f8e3fde314cc7>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -28,6 +28,7 @@ export default {
28
28
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
29
29
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
30
30
  '@atlaskit/design-system/use-button-group-label': 'warn',
31
+ '@atlaskit/design-system/use-cx-function-in-xcss': 'error',
31
32
  '@atlaskit/design-system/use-datetime-picker-calendar-button': 'warn',
32
33
  '@atlaskit/design-system/use-drawer-label': 'warn',
33
34
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': 'warn',
@@ -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::98f3a7e3c7f8f8532248994786f11c98>>
3
+ * @codegen <<SignedSource::85c1f4ada9dac0f66e87e3734a36cb6b>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -27,6 +27,7 @@ export default {
27
27
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
28
28
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
29
29
  '@atlaskit/design-system/use-button-group-label': 'warn',
30
+ '@atlaskit/design-system/use-cx-function-in-xcss': 'error',
30
31
  '@atlaskit/design-system/use-datetime-picker-calendar-button': 'warn',
31
32
  '@atlaskit/design-system/use-drawer-label': 'warn',
32
33
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': 'warn',
@@ -20,6 +20,7 @@ var defaultConfig = {
20
20
  };
21
21
  var createWithConfig = function createWithConfig(initialConfig) {
22
22
  return function (context) {
23
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
23
24
  var userConfig = context.options[0];
24
25
  // merge configs
25
26
  var config = {
@@ -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::551d1887446166d5a78fc51663d43e9c>>
3
+ * @codegen <<SignedSource::66749852497ab0f2dc3214dd47aaf598>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import consistentCssPropUsage from './consistent-css-prop-usage';
@@ -35,6 +35,7 @@ import noUnsafeStyleOverrides from './no-unsafe-style-overrides';
35
35
  import noUnsupportedDragAndDropLibraries from './no-unsupported-drag-and-drop-libraries';
36
36
  import preferPrimitives from './prefer-primitives';
37
37
  import useButtonGroupLabel from './use-button-group-label';
38
+ import useCxFunctionInXcss from './use-cx-function-in-xcss';
38
39
  import useDatetimePickerCalendarButton from './use-datetime-picker-calendar-button';
39
40
  import useDrawerLabel from './use-drawer-label';
40
41
  import useHeading from './use-heading';
@@ -85,6 +86,7 @@ export var rules = {
85
86
  'no-unsupported-drag-and-drop-libraries': noUnsupportedDragAndDropLibraries,
86
87
  'prefer-primitives': preferPrimitives,
87
88
  'use-button-group-label': useButtonGroupLabel,
89
+ 'use-cx-function-in-xcss': useCxFunctionInXcss,
88
90
  'use-datetime-picker-calendar-button': useDatetimePickerCalendarButton,
89
91
  'use-drawer-label': useDrawerLabel,
90
92
  'use-heading': useHeading,
@@ -32,6 +32,8 @@ var rule = createLintRule({
32
32
  create: function create(context) {
33
33
  var _context$options$;
34
34
  var isIconBase = createIsFromImportSourceFor('@atlaskit/icon', '@atlaskit/icon/base');
35
+
36
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
35
37
  var _ref = (_context$options$ = context.options[0]) !== null && _context$options$ !== void 0 ? _context$options$ : {},
36
38
  _ref$centralLocation = _ref.centralLocation,
37
39
  centralLocation = _ref$centralLocation === void 0 ? '' : _ref$centralLocation,
@@ -67,7 +67,9 @@ var rule = createLintRule({
67
67
  var _context$options$;
68
68
  // Get the rule configuration specified otherwise use default config.
69
69
  // A bit confusing as it seems that the default options have precedence over the user specified options.
70
- var deprecatedConfig = ((_context$options$ = context.options[0]) === null || _context$options$ === void 0 ? void 0 : _context$options$.deprecatedConfig) || getConfig('jsxAttributes');
70
+ var deprecatedConfig =
71
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
72
+ ((_context$options$ = context.options[0]) === null || _context$options$ === void 0 ? void 0 : _context$options$.deprecatedConfig) || getConfig('jsxAttributes');
71
73
  return {
72
74
  // find JSX attribute - find name of attribute - get source and find relevant identifiers.
73
75
  JSXAttribute: function JSXAttribute(node) {
@@ -32,7 +32,9 @@ export var createChecks = function createChecks(context) {
32
32
  type = _ref.type,
33
33
  node = _ref.node,
34
34
  importNames = _ref.importNames;
35
- var restrictedPathMessages = ((_context$options$ = context.options[0]) === null || _context$options$ === void 0 ? void 0 : _context$options$.deprecatedConfig) || getConfig('imports');
35
+ var restrictedPathMessages =
36
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
37
+ ((_context$options$ = context.options[0]) === null || _context$options$ === void 0 ? void 0 : _context$options$.deprecatedConfig) || getConfig('imports');
36
38
  if (!isDeprecatedImportConfig(restrictedPathMessages)) {
37
39
  throw new Error('Config is invalid for deprecated imports');
38
40
  }
@@ -311,7 +311,9 @@ var getLiteralStringValue = function getLiteralStringValue(value) {
311
311
  }
312
312
  return;
313
313
  };
314
- export var createHelpers = function createHelpers(context) {
314
+ export var createHelpers = function createHelpers(ctx) {
315
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
316
+ var context = ctx;
315
317
  /**
316
318
  * Extracts the token name of a token() call from a JSXExpressionContainer
317
319
  * @param value The JSXExpressionContainer to extract the token call from
@@ -49,6 +49,7 @@ var rule = createLintRule({
49
49
  }]
50
50
  },
51
51
  create: function create(context) {
52
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
52
53
  var config = _objectSpread({}, context.options[0]);
53
54
  if (!config.fallbackUsage) {
54
55
  config.fallbackUsage = config.shouldEnforceFallbacks ? 'forced' : 'none';
@@ -0,0 +1,91 @@
1
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
2
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4
+ import { isNodeOfType } from 'eslint-codemod-utils';
5
+ import { createLintRule } from '../utils/create-rule';
6
+ var rule = createLintRule({
7
+ meta: {
8
+ name: 'use-cx-function-in-xcss',
9
+ fixable: 'code',
10
+ hasSuggestions: true,
11
+ type: 'problem',
12
+ docs: {
13
+ description: 'Enforces cx function use to combine styles in xcss.',
14
+ recommended: true,
15
+ severity: 'error'
16
+ },
17
+ messages: {
18
+ useCxFunc: "Use the cx function when combining styles in the xcss prop."
19
+ }
20
+ },
21
+ create: function create(context) {
22
+ var importStatement = null;
23
+ var primitiveNames = new Set();
24
+ return {
25
+ "ImportDeclaration[source.value='@atlaskit/css']": function ImportDeclarationSourceValueAtlaskit_css(node) {
26
+ importStatement = {
27
+ node: node
28
+ };
29
+ var _iterator = _createForOfIteratorHelper(node.specifiers),
30
+ _step;
31
+ try {
32
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
33
+ var specifier = _step.value;
34
+ if (specifier.type === 'ImportSpecifier' && specifier.imported.name === 'cx') {
35
+ importStatement.cxFuncLocalName = specifier.local.name;
36
+ }
37
+ }
38
+ } catch (err) {
39
+ _iterator.e(err);
40
+ } finally {
41
+ _iterator.f();
42
+ }
43
+ },
44
+ 'ImportDeclaration[source.value="@atlaskit/primitives/compiled"]': function ImportDeclarationSourceValueAtlaskit_primitives_compiled(node) {
45
+ var _iterator2 = _createForOfIteratorHelper(node.specifiers),
46
+ _step2;
47
+ try {
48
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
49
+ var specifier = _step2.value;
50
+ primitiveNames.add(specifier.local.name);
51
+ }
52
+ } catch (err) {
53
+ _iterator2.e(err);
54
+ } finally {
55
+ _iterator2.f();
56
+ }
57
+ },
58
+ 'JSXAttribute > JSXIdentifier[name=/[xX]css$/]': function JSXAttribute__JSXIdentifierName_XXCss$_(node) {
59
+ var xcssValue = node.parent && isNodeOfType(node.parent, 'JSXAttribute') && node.parent.value && isNodeOfType(node.parent.value, 'JSXExpressionContainer') ? node.parent.value : undefined;
60
+ if (!xcssValue) {
61
+ return;
62
+ }
63
+ var jsxElementName = node.parent.parent && isNodeOfType(node.parent.parent, 'JSXOpeningElement') && node.parent.parent.name && isNodeOfType(node.parent.parent.name, 'JSXIdentifier') ? node.parent.parent.name.name : undefined;
64
+ if (!jsxElementName) {
65
+ return;
66
+ }
67
+ // check if this JSX element is from the primitives entry point and if prop value is an array
68
+ if (primitiveNames.has(jsxElementName) && xcssValue.expression.type === 'ArrayExpression') {
69
+ context.report({
70
+ node: xcssValue,
71
+ messageId: 'useCxFunc',
72
+ fix: function fix(fixer) {
73
+ var fixes = [];
74
+ var sourceCode = context.sourceCode;
75
+ var styles = sourceCode.getText(xcssValue.expression);
76
+ fixes.push(fixer.replaceText(xcssValue, (importStatement && importStatement.cxFuncLocalName ? "{".concat(importStatement.cxFuncLocalName) : "{cx") + "(".concat(styles.replace(/^\[/, '').replace(/\]$/, ''), ")}")));
77
+ if (!importStatement) {
78
+ fixes.push(fixer.insertTextBeforeRange([0, 0], "import { cx } from '@atlaskit/css';\n"));
79
+ } else if (!importStatement.cxFuncLocalName) {
80
+ var importText = sourceCode.getText(importStatement.node);
81
+ fixes.push(fixer.replaceText(importStatement.node, importText.includes('{') ? importText.replace(/import(.*) {\s?/, "import$1 { cx, ") : importText.replace(/ from /, ", { cx } from ")));
82
+ }
83
+ return fixes;
84
+ }
85
+ });
86
+ }
87
+ }
88
+ };
89
+ }
90
+ });
91
+ export default rule;
@@ -31,6 +31,7 @@ var rule = createLintRule({
31
31
  }
32
32
  },
33
33
  create: function create(context) {
34
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
34
35
  var config = getConfig(context.options[0]);
35
36
  return errorBoundary({
36
37
  // transforms <h1>...</h1> usages
@@ -40,6 +40,7 @@ var rule = createLintRule({
40
40
  }
41
41
  },
42
42
  create: function create(context) {
43
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
43
44
  var config = getConfig(context.options[0]);
44
45
  return errorBoundary({
45
46
  'CallExpression[callee.name="xcss"] ObjectExpression > Property > Identifier[name=/(fontSize|lineHeight|fontWeight|letterSpacing)/]': function CallExpressionCalleeNameXcss_ObjectExpression__Property__IdentifierName_FontSizeLineHeightFontWeightLetterSpacing_(node) {
@@ -32,6 +32,7 @@ var rule = createLintRule({
32
32
  }
33
33
  },
34
34
  create: function create(context) {
35
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
35
36
  var config = getConfig(context.options[0]);
36
37
  return {
37
38
  // transforms styled.<html>(...) usages
@@ -47,6 +47,7 @@ var rule = createLintRule({
47
47
  }
48
48
  },
49
49
  create: function create(context) {
50
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
50
51
  var config = getConfig(context.options[0]);
51
52
  return errorBoundary({
52
53
  'JSXElement[openingElement.name.name=span]': function JSXElementOpeningElementNameNameSpan(node) {
@@ -8,6 +8,7 @@ import { RestrictedCapitalisation } from './transformers/restricted-capitalisati
8
8
  import { StyleObject } from './transformers/style-object';
9
9
  import { UntokenizedProperties } from './transformers/untokenized-properties';
10
10
  var create = function create(context) {
11
+ // TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
11
12
  var config = getConfig(context.options[0]);
12
13
  return errorBoundary({
13
14
  // const styles = css({ fontSize: '14px', ... }), styled.div({ fontSize: 14, ... })
@@ -47,6 +47,7 @@ export declare const plugin: {
47
47
  'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
48
48
  'prefer-primitives': import("eslint").Rule.RuleModule;
49
49
  'use-button-group-label': import("eslint").Rule.RuleModule;
50
+ 'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
50
51
  'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
51
52
  'use-drawer-label': import("eslint").Rule.RuleModule;
52
53
  'use-heading': import("eslint").Rule.RuleModule;
@@ -100,6 +101,7 @@ export declare const plugin: {
100
101
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
101
102
  '@atlaskit/design-system/prefer-primitives': "warn";
102
103
  '@atlaskit/design-system/use-button-group-label': "warn";
104
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
103
105
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
104
106
  '@atlaskit/design-system/use-drawer-label': "warn";
105
107
  '@atlaskit/design-system/use-heading': "warn";
@@ -155,6 +157,7 @@ export declare const plugin: {
155
157
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
156
158
  '@atlaskit/design-system/prefer-primitives': "warn";
157
159
  '@atlaskit/design-system/use-button-group-label': "warn";
160
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
158
161
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
159
162
  '@atlaskit/design-system/use-drawer-label': "warn";
160
163
  '@atlaskit/design-system/use-heading': "warn";
@@ -197,6 +200,7 @@ export declare const plugin: {
197
200
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
198
201
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
199
202
  '@atlaskit/design-system/use-button-group-label': "warn";
203
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
200
204
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
201
205
  '@atlaskit/design-system/use-drawer-label': "warn";
202
206
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -236,6 +240,7 @@ export declare const plugin: {
236
240
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
237
241
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
238
242
  '@atlaskit/design-system/use-button-group-label': "warn";
243
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
239
244
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
240
245
  '@atlaskit/design-system/use-drawer-label': "warn";
241
246
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -287,6 +292,7 @@ declare const configs: {
287
292
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
288
293
  '@atlaskit/design-system/prefer-primitives': "warn";
289
294
  '@atlaskit/design-system/use-button-group-label': "warn";
295
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
290
296
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
291
297
  '@atlaskit/design-system/use-drawer-label': "warn";
292
298
  '@atlaskit/design-system/use-heading': "warn";
@@ -342,6 +348,7 @@ declare const configs: {
342
348
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
343
349
  '@atlaskit/design-system/prefer-primitives': "warn";
344
350
  '@atlaskit/design-system/use-button-group-label': "warn";
351
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
345
352
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
346
353
  '@atlaskit/design-system/use-drawer-label': "warn";
347
354
  '@atlaskit/design-system/use-heading': "warn";
@@ -384,6 +391,7 @@ declare const configs: {
384
391
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
385
392
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
386
393
  '@atlaskit/design-system/use-button-group-label': "warn";
394
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
387
395
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
388
396
  '@atlaskit/design-system/use-drawer-label': "warn";
389
397
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -423,6 +431,7 @@ declare const configs: {
423
431
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
424
432
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
425
433
  '@atlaskit/design-system/use-button-group-label': "warn";
434
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
426
435
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
427
436
  '@atlaskit/design-system/use-drawer-label': "warn";
428
437
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -32,6 +32,7 @@ declare const _default: {
32
32
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
33
33
  '@atlaskit/design-system/prefer-primitives': "warn";
34
34
  '@atlaskit/design-system/use-button-group-label': "warn";
35
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
35
36
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
36
37
  '@atlaskit/design-system/use-drawer-label': "warn";
37
38
  '@atlaskit/design-system/use-heading': "warn";
@@ -32,6 +32,7 @@ declare const _default: {
32
32
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
33
33
  '@atlaskit/design-system/prefer-primitives': "warn";
34
34
  '@atlaskit/design-system/use-button-group-label': "warn";
35
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
35
36
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
36
37
  '@atlaskit/design-system/use-drawer-label': "warn";
37
38
  '@atlaskit/design-system/use-heading': "warn";
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
22
22
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
23
23
  '@atlaskit/design-system/use-button-group-label': "warn";
24
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
24
25
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
25
26
  '@atlaskit/design-system/use-drawer-label': "warn";
26
27
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
22
22
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
23
23
  '@atlaskit/design-system/use-button-group-label': "warn";
24
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
24
25
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
25
26
  '@atlaskit/design-system/use-drawer-label': "warn";
26
27
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -31,6 +31,7 @@ export declare const rules: {
31
31
  'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
32
32
  'prefer-primitives': import("eslint").Rule.RuleModule;
33
33
  'use-button-group-label': import("eslint").Rule.RuleModule;
34
+ 'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
34
35
  'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
35
36
  'use-drawer-label': import("eslint").Rule.RuleModule;
36
37
  'use-heading': import("eslint").Rule.RuleModule;
@@ -96,7 +96,7 @@ export declare const createAutoMigrationError: ({ node, importSource, iconName,
96
96
  spacing?: string | undefined;
97
97
  insideNewButton?: boolean | undefined;
98
98
  }) => void;
99
- export declare const createHelpers: (context: Rule.RuleContext) => {
99
+ export declare const createHelpers: (ctx: Rule.RuleContext) => {
100
100
  /**
101
101
  * Extracts the primaryColor value from a JSXAttribute
102
102
  */
@@ -0,0 +1,3 @@
1
+ import type { Rule } from 'eslint';
2
+ declare const rule: Rule.RuleModule;
3
+ export default rule;
@@ -47,6 +47,7 @@ export declare const plugin: {
47
47
  'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
48
48
  'prefer-primitives': import("eslint").Rule.RuleModule;
49
49
  'use-button-group-label': import("eslint").Rule.RuleModule;
50
+ 'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
50
51
  'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
51
52
  'use-drawer-label': import("eslint").Rule.RuleModule;
52
53
  'use-heading': import("eslint").Rule.RuleModule;
@@ -103,6 +104,7 @@ export declare const plugin: {
103
104
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
104
105
  '@atlaskit/design-system/prefer-primitives': "warn";
105
106
  '@atlaskit/design-system/use-button-group-label': "warn";
107
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
106
108
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
107
109
  '@atlaskit/design-system/use-drawer-label': "warn";
108
110
  '@atlaskit/design-system/use-heading': "warn";
@@ -161,6 +163,7 @@ export declare const plugin: {
161
163
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
162
164
  '@atlaskit/design-system/prefer-primitives': "warn";
163
165
  '@atlaskit/design-system/use-button-group-label': "warn";
166
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
164
167
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
165
168
  '@atlaskit/design-system/use-drawer-label': "warn";
166
169
  '@atlaskit/design-system/use-heading': "warn";
@@ -206,6 +209,7 @@ export declare const plugin: {
206
209
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
207
210
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
208
211
  '@atlaskit/design-system/use-button-group-label': "warn";
212
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
209
213
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
210
214
  '@atlaskit/design-system/use-drawer-label': "warn";
211
215
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -248,6 +252,7 @@ export declare const plugin: {
248
252
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
249
253
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
250
254
  '@atlaskit/design-system/use-button-group-label': "warn";
255
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
251
256
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
252
257
  '@atlaskit/design-system/use-drawer-label': "warn";
253
258
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -302,6 +307,7 @@ declare const configs: {
302
307
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
303
308
  '@atlaskit/design-system/prefer-primitives': "warn";
304
309
  '@atlaskit/design-system/use-button-group-label': "warn";
310
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
305
311
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
306
312
  '@atlaskit/design-system/use-drawer-label': "warn";
307
313
  '@atlaskit/design-system/use-heading': "warn";
@@ -360,6 +366,7 @@ declare const configs: {
360
366
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
361
367
  '@atlaskit/design-system/prefer-primitives': "warn";
362
368
  '@atlaskit/design-system/use-button-group-label': "warn";
369
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
363
370
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
364
371
  '@atlaskit/design-system/use-drawer-label': "warn";
365
372
  '@atlaskit/design-system/use-heading': "warn";
@@ -405,6 +412,7 @@ declare const configs: {
405
412
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
406
413
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
407
414
  '@atlaskit/design-system/use-button-group-label': "warn";
415
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
408
416
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
409
417
  '@atlaskit/design-system/use-drawer-label': "warn";
410
418
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -447,6 +455,7 @@ declare const configs: {
447
455
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
448
456
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
449
457
  '@atlaskit/design-system/use-button-group-label': "warn";
458
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
450
459
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
451
460
  '@atlaskit/design-system/use-drawer-label': "warn";
452
461
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -35,6 +35,7 @@ declare const _default: {
35
35
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
36
36
  '@atlaskit/design-system/prefer-primitives': "warn";
37
37
  '@atlaskit/design-system/use-button-group-label': "warn";
38
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
38
39
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
39
40
  '@atlaskit/design-system/use-drawer-label': "warn";
40
41
  '@atlaskit/design-system/use-heading': "warn";
@@ -35,6 +35,7 @@ declare const _default: {
35
35
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
36
36
  '@atlaskit/design-system/prefer-primitives': "warn";
37
37
  '@atlaskit/design-system/use-button-group-label': "warn";
38
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
38
39
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
39
40
  '@atlaskit/design-system/use-drawer-label': "warn";
40
41
  '@atlaskit/design-system/use-heading': "warn";
@@ -24,6 +24,7 @@ declare const _default: {
24
24
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
25
25
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
26
26
  '@atlaskit/design-system/use-button-group-label': "warn";
27
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
27
28
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
28
29
  '@atlaskit/design-system/use-drawer-label': "warn";
29
30
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -24,6 +24,7 @@ declare const _default: {
24
24
  '@atlaskit/design-system/no-unsafe-style-overrides': "warn";
25
25
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
26
26
  '@atlaskit/design-system/use-button-group-label': "warn";
27
+ '@atlaskit/design-system/use-cx-function-in-xcss': "error";
27
28
  '@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
28
29
  '@atlaskit/design-system/use-drawer-label': "warn";
29
30
  '@atlaskit/design-system/use-heading-level-in-spotlight-card': "warn";
@@ -31,6 +31,7 @@ export declare const rules: {
31
31
  'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
32
32
  'prefer-primitives': import("eslint").Rule.RuleModule;
33
33
  'use-button-group-label': import("eslint").Rule.RuleModule;
34
+ 'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
34
35
  'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
35
36
  'use-drawer-label': import("eslint").Rule.RuleModule;
36
37
  'use-heading': import("eslint").Rule.RuleModule;
@@ -101,7 +101,7 @@ export declare const createAutoMigrationError: ({ node, importSource, iconName,
101
101
  spacing?: string | undefined;
102
102
  insideNewButton?: boolean | undefined;
103
103
  }) => void;
104
- export declare const createHelpers: (context: Rule.RuleContext) => {
104
+ export declare const createHelpers: (ctx: Rule.RuleContext) => {
105
105
  /**
106
106
  * Extracts the primaryColor value from a JSXAttribute
107
107
  */
@@ -0,0 +1,3 @@
1
+ import type { Rule } from 'eslint';
2
+ declare const rule: Rule.RuleModule;
3
+ export default rule;
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.3.0",
4
+ "version": "13.4.0",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -44,9 +44,9 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@atlaskit/eslint-utils": "^2.0.0",
47
- "@atlaskit/icon": "^25.2.0",
48
- "@atlaskit/icon-lab": "^4.5.0",
49
- "@atlaskit/tokens": "^4.5.0",
47
+ "@atlaskit/icon": "^25.5.0",
48
+ "@atlaskit/icon-lab": "^4.6.0",
49
+ "@atlaskit/tokens": "^4.6.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@typescript-eslint/utils": "^7.1.0",
52
52
  "ajv": "^6.12.6",