@atlaskit/eslint-plugin-design-system 10.22.1 → 10.23.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 (43) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -0
  3. package/dist/cjs/index.codegen.js +44 -10
  4. package/dist/cjs/index.js +29 -2
  5. package/dist/cjs/presets/all-flat.codegen.js +61 -0
  6. package/dist/cjs/presets/all.codegen.js +2 -1
  7. package/dist/cjs/presets/recommended-flat.codegen.js +45 -0
  8. package/dist/cjs/presets/recommended.codegen.js +2 -1
  9. package/dist/cjs/rules/index.codegen.js +6 -3
  10. package/dist/cjs/rules/no-separator-with-list-elements/index.js +62 -0
  11. package/dist/es2019/index.codegen.js +46 -6
  12. package/dist/es2019/index.js +1 -1
  13. package/dist/es2019/presets/all-flat.codegen.js +55 -0
  14. package/dist/es2019/presets/all.codegen.js +2 -1
  15. package/dist/es2019/presets/recommended-flat.codegen.js +39 -0
  16. package/dist/es2019/presets/recommended.codegen.js +2 -1
  17. package/dist/es2019/rules/index.codegen.js +4 -2
  18. package/dist/es2019/rules/no-separator-with-list-elements/index.js +50 -0
  19. package/dist/esm/index.codegen.js +44 -6
  20. package/dist/esm/index.js +1 -1
  21. package/dist/esm/presets/all-flat.codegen.js +55 -0
  22. package/dist/esm/presets/all.codegen.js +2 -1
  23. package/dist/esm/presets/recommended-flat.codegen.js +39 -0
  24. package/dist/esm/presets/recommended.codegen.js +2 -1
  25. package/dist/esm/rules/index.codegen.js +4 -2
  26. package/dist/esm/rules/no-separator-with-list-elements/index.js +56 -0
  27. package/dist/types/index.codegen.d.ts +508 -77
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/presets/all-flat.codegen.d.ts +55 -0
  30. package/dist/types/presets/all.codegen.d.ts +47 -46
  31. package/dist/types/presets/recommended-flat.codegen.d.ts +39 -0
  32. package/dist/types/presets/recommended.codegen.d.ts +31 -30
  33. package/dist/types/rules/index.codegen.d.ts +2 -2
  34. package/dist/types/rules/no-separator-with-list-elements/index.d.ts +3 -0
  35. package/dist/types-ts4.5/index.codegen.d.ts +592 -77
  36. package/dist/types-ts4.5/index.d.ts +1 -1
  37. package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +63 -0
  38. package/dist/types-ts4.5/presets/all.codegen.d.ts +57 -46
  39. package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +47 -0
  40. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +41 -30
  41. package/dist/types-ts4.5/rules/index.codegen.d.ts +2 -2
  42. package/dist/types-ts4.5/rules/no-separator-with-list-elements/index.d.ts +3 -0
  43. package/package.json +4 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 10.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#153668](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/153668)
8
+ [`a6c96d74835d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a6c96d74835d5) -
9
+ Added a flat config preset equivalents for included eslint configs
10
+ - [#153712](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/153712)
11
+ [`566eb89dd2b9f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/566eb89dd2b9f) -
12
+ Introducing new rule to warn the combination of separator and `as="li|ol|dl"`
13
+
3
14
  ## 10.22.1
4
15
 
5
16
  ### Patch Changes
package/README.md CHANGED
@@ -73,6 +73,7 @@ module.exports = {
73
73
  | <a href="./src/rules/no-margin/README.md">no-margin</a> | Disallow using the margin CSS property. | | | |
74
74
  | <a href="./src/rules/no-nested-styles/README.md">no-nested-styles</a> | Disallows use of nested styles in `css` functions. | Yes | | |
75
75
  | <a href="./src/rules/no-physical-properties/README.md">no-physical-properties</a> | Disallow physical properties and values in `css` function calls. | | Yes | |
76
+ | <a href="./src/rules/no-separator-with-list-elements/README.md">no-separator-with-list-elements</a> | Warn when the `separator` prop is used with `as="li"`, `as="ol"`, or `as="dl"` in the Inline component. | Yes | | |
76
77
  | <a href="./src/rules/no-styled-tagged-template-expression/README.md">no-styled-tagged-template-expression</a> | Disallows any `styled` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
77
78
  | <a href="./src/rules/no-unsafe-design-token-usage/README.md">no-unsafe-design-token-usage</a> | Enforces design token usage is statically and locally analyzable. | Yes | Yes | |
78
79
  | <a href="./src/rules/no-unsafe-style-overrides/README.md">no-unsafe-style-overrides</a> | Discourage usage of unsafe style overrides used against the Atlassian Design System. | Yes | | |
@@ -4,23 +4,57 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.configs = void 0;
7
+ exports.plugin = exports.name = exports.default = exports.configs = void 0;
8
8
  Object.defineProperty(exports, "rules", {
9
9
  enumerable: true,
10
10
  get: function get() {
11
- return _index.default;
11
+ return _index.rules;
12
12
  }
13
13
  });
14
+ exports.version = void 0;
15
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
+ var _allFlat = _interopRequireDefault(require("./presets/all-flat.codegen"));
14
17
  var _all = _interopRequireDefault(require("./presets/all.codegen"));
18
+ var _recommendedFlat = _interopRequireDefault(require("./presets/recommended-flat.codegen"));
15
19
  var _recommended = _interopRequireDefault(require("./presets/recommended.codegen"));
16
- var _index = _interopRequireDefault(require("./rules/index.codegen"));
17
- /**
20
+ var _index = require("./rules/index.codegen");
21
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
18
23
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
19
- * @codegen <<SignedSource::abdb6f8b0dfdc4e2489691c04488f46e>>
24
+ * @codegen <<SignedSource::7656123b732a9145dedb7f9eee588883>>
20
25
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
21
26
  */
22
-
23
- var configs = exports.configs = {
24
- all: _all.default,
25
- recommended: _recommended.default
26
- };
27
+ // this uses require because not all node versions this package supports use the same import assertions/attributes
28
+ var pkgJson = require('../package.json');
29
+ var version = exports.version = pkgJson.version,
30
+ name = exports.name = pkgJson.name;
31
+ var plugin = exports.plugin = {
32
+ meta: {
33
+ name: name,
34
+ version: version
35
+ },
36
+ rules: _index.rules,
37
+ // flat configs need to be done like this so they can get a reference to the plugin.
38
+ // see here: https://eslint.org/docs/latest/extend/plugins#configs-in-plugins
39
+ // they cannot use `Object.assign` because it will not work with the getter
40
+ configs: {
41
+ all: _all.default,
42
+ 'all/flat': _objectSpread(_objectSpread({}, _allFlat.default), {}, {
43
+ plugins: _objectSpread(_objectSpread({}, _allFlat.default.plugins), {}, {
44
+ get '@atlaskit/design-system'() {
45
+ return plugin;
46
+ }
47
+ })
48
+ }),
49
+ recommended: _recommended.default,
50
+ 'recommended/flat': _objectSpread(_objectSpread({}, _recommendedFlat.default), {}, {
51
+ plugins: _objectSpread(_objectSpread({}, _recommendedFlat.default.plugins), {}, {
52
+ get '@atlaskit/design-system'() {
53
+ return plugin;
54
+ }
55
+ })
56
+ })
57
+ }
58
+ };
59
+ var configs = exports.configs = plugin.configs;
60
+ var _default = exports.default = plugin;
package/dist/cjs/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -9,17 +10,43 @@ Object.defineProperty(exports, "configs", {
9
10
  return _index.configs;
10
11
  }
11
12
  });
13
+ Object.defineProperty(exports, "default", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _index.default;
17
+ }
18
+ });
12
19
  Object.defineProperty(exports, "filterActionableDeprecations", {
13
20
  enumerable: true,
14
21
  get: function get() {
15
22
  return _filterActionableDeprecations.filterActionableDeprecations;
16
23
  }
17
24
  });
25
+ Object.defineProperty(exports, "name", {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _index.name;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "plugin", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _index.plugin;
35
+ }
36
+ });
18
37
  Object.defineProperty(exports, "rules", {
19
38
  enumerable: true,
20
39
  get: function get() {
21
40
  return _index.rules;
22
41
  }
23
42
  });
24
- var _index = require("./index.codegen");
25
- var _filterActionableDeprecations = require("./rules/no-deprecated-apis/helpers/filter-actionable-deprecations");
43
+ Object.defineProperty(exports, "version", {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _index.version;
47
+ }
48
+ });
49
+ var _index = _interopRequireWildcard(require("./index.codegen"));
50
+ var _filterActionableDeprecations = require("./rules/no-deprecated-apis/helpers/filter-actionable-deprecations");
51
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
52
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
+ * @codegen <<SignedSource::56a9d309ec6f548dce4a4f6e99059a15>>
10
+ * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
+ */
12
+ var _default = exports.default = {
13
+ // NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
14
+ plugins: {},
15
+ rules: {
16
+ '@atlaskit/design-system/consistent-css-prop-usage': 'error',
17
+ '@atlaskit/design-system/ensure-design-token-usage': 'error',
18
+ '@atlaskit/design-system/ensure-design-token-usage/preview': 'warn',
19
+ '@atlaskit/design-system/ensure-icon-color': 'error',
20
+ '@atlaskit/design-system/icon-label': 'warn',
21
+ '@atlaskit/design-system/no-banned-imports': 'error',
22
+ '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
23
+ '@atlaskit/design-system/no-custom-icons': 'warn',
24
+ '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
25
+ '@atlaskit/design-system/no-deprecated-apis': 'error',
26
+ '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
27
+ '@atlaskit/design-system/no-deprecated-imports': 'error',
28
+ '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': 'error',
29
+ '@atlaskit/design-system/no-html-anchor': 'warn',
30
+ '@atlaskit/design-system/no-html-button': 'warn',
31
+ '@atlaskit/design-system/no-invalid-css-map': ['error', {
32
+ allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
33
+ }],
34
+ '@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
35
+ '@atlaskit/design-system/no-legacy-icons': 'warn',
36
+ '@atlaskit/design-system/no-margin': 'warn',
37
+ '@atlaskit/design-system/no-nested-styles': 'error',
38
+ '@atlaskit/design-system/no-physical-properties': 'error',
39
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
40
+ '@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
41
+ '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
42
+ '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
43
+ '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
44
+ '@atlaskit/design-system/prefer-primitives': 'warn',
45
+ '@atlaskit/design-system/use-button-group-label': 'warn',
46
+ '@atlaskit/design-system/use-drawer-label': 'warn',
47
+ '@atlaskit/design-system/use-heading': 'warn',
48
+ '@atlaskit/design-system/use-heading-level-in-spotlight-card': 'warn',
49
+ '@atlaskit/design-system/use-href-in-link-item': 'warn',
50
+ '@atlaskit/design-system/use-latest-xcss-syntax': 'error',
51
+ '@atlaskit/design-system/use-latest-xcss-syntax-typography': 'warn',
52
+ '@atlaskit/design-system/use-menu-section-title': 'warn',
53
+ '@atlaskit/design-system/use-popup-label': 'warn',
54
+ '@atlaskit/design-system/use-primitives': 'warn',
55
+ '@atlaskit/design-system/use-primitives-text': 'warn',
56
+ '@atlaskit/design-system/use-tag-group-label': 'warn',
57
+ '@atlaskit/design-system/use-tokens-space': 'error',
58
+ '@atlaskit/design-system/use-tokens-typography': 'warn',
59
+ '@atlaskit/design-system/use-visually-hidden': 'error'
60
+ }
61
+ };
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  /**
8
8
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
- * @codegen <<SignedSource::310e184a1b8eca0da1246cfe8d128e2c>>
9
+ * @codegen <<SignedSource::47f018ad98455be31dc522bcf5360adf>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -35,6 +35,7 @@ var _default = exports.default = {
35
35
  '@atlaskit/design-system/no-margin': 'warn',
36
36
  '@atlaskit/design-system/no-nested-styles': 'error',
37
37
  '@atlaskit/design-system/no-physical-properties': 'error',
38
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
38
39
  '@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
39
40
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
40
41
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
+ * @codegen <<SignedSource::9c6dda34a88386c4fa5b931ab4baf929>>
10
+ * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
+ */
12
+ var _default = exports.default = {
13
+ // NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
14
+ plugins: {},
15
+ rules: {
16
+ '@atlaskit/design-system/consistent-css-prop-usage': 'error',
17
+ '@atlaskit/design-system/ensure-design-token-usage': 'error',
18
+ '@atlaskit/design-system/icon-label': 'warn',
19
+ '@atlaskit/design-system/no-banned-imports': 'error',
20
+ '@atlaskit/design-system/no-deprecated-apis': 'error',
21
+ '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
22
+ '@atlaskit/design-system/no-deprecated-imports': 'error',
23
+ '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': 'error',
24
+ '@atlaskit/design-system/no-html-anchor': 'warn',
25
+ '@atlaskit/design-system/no-html-button': 'warn',
26
+ '@atlaskit/design-system/no-invalid-css-map': ['error', {
27
+ allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
28
+ }],
29
+ '@atlaskit/design-system/no-nested-styles': 'error',
30
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
31
+ '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
32
+ '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
33
+ '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
34
+ '@atlaskit/design-system/use-button-group-label': 'warn',
35
+ '@atlaskit/design-system/use-drawer-label': 'warn',
36
+ '@atlaskit/design-system/use-heading-level-in-spotlight-card': 'warn',
37
+ '@atlaskit/design-system/use-href-in-link-item': 'warn',
38
+ '@atlaskit/design-system/use-latest-xcss-syntax': 'error',
39
+ '@atlaskit/design-system/use-latest-xcss-syntax-typography': 'warn',
40
+ '@atlaskit/design-system/use-menu-section-title': 'warn',
41
+ '@atlaskit/design-system/use-popup-label': 'warn',
42
+ '@atlaskit/design-system/use-tag-group-label': 'warn',
43
+ '@atlaskit/design-system/use-visually-hidden': 'error'
44
+ }
45
+ };
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  /**
8
8
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
- * @codegen <<SignedSource::9be7e90918082d78473f5d2a2271b15c>>
9
+ * @codegen <<SignedSource::f1b4aa9e656294739485e62ba4a33f9d>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -26,6 +26,7 @@ var _default = exports.default = {
26
26
  allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
27
27
  }],
28
28
  '@atlaskit/design-system/no-nested-styles': 'error',
29
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
29
30
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
30
31
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
31
32
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.rules = void 0;
8
8
  var _consistentCssPropUsage = _interopRequireDefault(require("./consistent-css-prop-usage"));
9
9
  var _ensureDesignTokenUsage = _interopRequireDefault(require("./ensure-design-token-usage"));
10
10
  var _ensureDesignTokenUsagePreview = _interopRequireDefault(require("./ensure-design-token-usage-preview"));
@@ -29,6 +29,7 @@ var _noLegacyIcons = _interopRequireDefault(require("./no-legacy-icons"));
29
29
  var _noMargin = _interopRequireDefault(require("./no-margin"));
30
30
  var _noNestedStyles = _interopRequireDefault(require("./no-nested-styles"));
31
31
  var _noPhysicalProperties = _interopRequireDefault(require("./no-physical-properties"));
32
+ var _noSeparatorWithListElements = _interopRequireDefault(require("./no-separator-with-list-elements"));
32
33
  var _noStyledTaggedTemplateExpression = _interopRequireDefault(require("./no-styled-tagged-template-expression"));
33
34
  var _noUnsafeDesignTokenUsage = _interopRequireDefault(require("./no-unsafe-design-token-usage"));
34
35
  var _noUnsafeStyleOverrides = _interopRequireDefault(require("./no-unsafe-style-overrides"));
@@ -51,10 +52,11 @@ var _useTokensTypography = _interopRequireDefault(require("./use-tokens-typograp
51
52
  var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
52
53
  /**
53
54
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
54
- * @codegen <<SignedSource::2c61c8c9aa86b4fb1d11e0bcba9d83a1>>
55
+ * @codegen <<SignedSource::2ab06b34c4e08cd70b0f67f5915f12c9>>
55
56
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
56
57
  */
57
- var _default = exports.default = {
58
+
59
+ var rules = exports.rules = {
58
60
  'consistent-css-prop-usage': _consistentCssPropUsage.default,
59
61
  'ensure-design-token-usage': _ensureDesignTokenUsage.default,
60
62
  'ensure-design-token-usage/preview': _ensureDesignTokenUsagePreview.default,
@@ -79,6 +81,7 @@ var _default = exports.default = {
79
81
  'no-margin': _noMargin.default,
80
82
  'no-nested-styles': _noNestedStyles.default,
81
83
  'no-physical-properties': _noPhysicalProperties.default,
84
+ 'no-separator-with-list-elements': _noSeparatorWithListElements.default,
82
85
  'no-styled-tagged-template-expression': _noStyledTaggedTemplateExpression.default,
83
86
  'no-unsafe-design-token-usage': _noUnsafeDesignTokenUsage.default,
84
87
  'no-unsafe-style-overrides': _noUnsafeStyleOverrides.default,
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _eslintCodemodUtils = require("eslint-codemod-utils");
8
+ var _createRule = require("../utils/create-rule");
9
+ var separatorAsCombinationNotAllowed = 'The combination of `separator` with `as="li"`, `as="ol"`, or `as="dl"` is not allowed.';
10
+ var rule = (0, _createRule.createLintRule)({
11
+ meta: {
12
+ name: 'no-separator-with-list-elements',
13
+ type: 'suggestion',
14
+ docs: {
15
+ description: 'Warn when the `separator` prop is used with `as="li"`, `as="ol"`, or `as="dl"` in the Inline component.',
16
+ recommended: true,
17
+ severity: 'warn'
18
+ },
19
+ messages: {
20
+ separatorAsCombinationNotAllowed: separatorAsCombinationNotAllowed
21
+ }
22
+ },
23
+ create: function create(context) {
24
+ var inlineComponentNames = [];
25
+ return {
26
+ ImportDeclaration: function ImportDeclaration(node) {
27
+ if (node.type === 'ImportDeclaration' && (node.source.value === '../src' || node.source.value === '@atlaskit/primitives')) {
28
+ node.specifiers.forEach(function (specifier) {
29
+ if (specifier.type === 'ImportSpecifier' && specifier.imported.name === 'Inline') {
30
+ inlineComponentNames.push(specifier.local.name);
31
+ }
32
+ });
33
+ }
34
+ },
35
+ JSXElement: function JSXElement(node) {
36
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement') || !(0, _eslintCodemodUtils.isNodeOfType)(node.openingElement.name, 'JSXIdentifier')) {
37
+ return;
38
+ }
39
+ var componentName = node.openingElement.name.name;
40
+ if (!inlineComponentNames.includes(componentName)) {
41
+ return;
42
+ }
43
+ var inlineProps = node.openingElement.attributes.filter(function (attr) {
44
+ return (0, _eslintCodemodUtils.isNodeOfType)(attr, 'JSXAttribute') && (0, _eslintCodemodUtils.isNodeOfType)(attr.name, 'JSXIdentifier');
45
+ });
46
+ var separatorProp = inlineProps.find(function (attr) {
47
+ return attr.name.name === 'separator';
48
+ });
49
+ var asProp = inlineProps.find(function (attr) {
50
+ return attr.name.name === 'as';
51
+ });
52
+ if (separatorProp && asProp && asProp.value && (0, _eslintCodemodUtils.isNodeOfType)(asProp.value, 'Literal') && ['li', 'ol', 'dl'].includes(asProp.value.value)) {
53
+ context.report({
54
+ node: node,
55
+ messageId: 'separatorAsCombinationNotAllowed'
56
+ });
57
+ }
58
+ }
59
+ };
60
+ }
61
+ });
62
+ var _default = exports.default = rule;
@@ -1,12 +1,52 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::abdb6f8b0dfdc4e2489691c04488f46e>>
3
+ * @codegen <<SignedSource::7656123b732a9145dedb7f9eee588883>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
+ import allFlat from './presets/all-flat.codegen';
6
7
  import all from './presets/all.codegen';
8
+ import recommendedFlat from './presets/recommended-flat.codegen';
7
9
  import recommended from './presets/recommended.codegen';
8
- export { default as rules } from './rules/index.codegen';
9
- export const configs = {
10
- all,
11
- recommended
12
- };
10
+ import { rules } from './rules/index.codegen';
11
+
12
+ // this uses require because not all node versions this package supports use the same import assertions/attributes
13
+ const pkgJson = require('../package.json');
14
+ export const {
15
+ version,
16
+ name
17
+ } = pkgJson;
18
+ export const plugin = {
19
+ meta: {
20
+ name,
21
+ version
22
+ },
23
+ rules,
24
+ // flat configs need to be done like this so they can get a reference to the plugin.
25
+ // see here: https://eslint.org/docs/latest/extend/plugins#configs-in-plugins
26
+ // they cannot use `Object.assign` because it will not work with the getter
27
+ configs: {
28
+ all,
29
+ 'all/flat': {
30
+ ...allFlat,
31
+ plugins: {
32
+ ...allFlat.plugins,
33
+ get '@atlaskit/design-system'() {
34
+ return plugin;
35
+ }
36
+ }
37
+ },
38
+ recommended,
39
+ 'recommended/flat': {
40
+ ...recommendedFlat,
41
+ plugins: {
42
+ ...recommendedFlat.plugins,
43
+ get '@atlaskit/design-system'() {
44
+ return plugin;
45
+ }
46
+ }
47
+ }
48
+ }
49
+ };
50
+ export { rules } from './rules/index.codegen';
51
+ export const configs = plugin.configs;
52
+ export default plugin;
@@ -1,2 +1,2 @@
1
- export { configs, rules } from './index.codegen';
1
+ export { version, name, rules, plugin, configs, default } from './index.codegen';
2
2
  export { filterActionableDeprecations } from './rules/no-deprecated-apis/helpers/filter-actionable-deprecations';
@@ -0,0 +1,55 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ * @codegen <<SignedSource::56a9d309ec6f548dce4a4f6e99059a15>>
4
+ * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
+ */
6
+ export default {
7
+ // NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
8
+ plugins: {},
9
+ rules: {
10
+ '@atlaskit/design-system/consistent-css-prop-usage': 'error',
11
+ '@atlaskit/design-system/ensure-design-token-usage': 'error',
12
+ '@atlaskit/design-system/ensure-design-token-usage/preview': 'warn',
13
+ '@atlaskit/design-system/ensure-icon-color': 'error',
14
+ '@atlaskit/design-system/icon-label': 'warn',
15
+ '@atlaskit/design-system/no-banned-imports': 'error',
16
+ '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
17
+ '@atlaskit/design-system/no-custom-icons': 'warn',
18
+ '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
19
+ '@atlaskit/design-system/no-deprecated-apis': 'error',
20
+ '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
21
+ '@atlaskit/design-system/no-deprecated-imports': 'error',
22
+ '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': 'error',
23
+ '@atlaskit/design-system/no-html-anchor': 'warn',
24
+ '@atlaskit/design-system/no-html-button': 'warn',
25
+ '@atlaskit/design-system/no-invalid-css-map': ['error', {
26
+ allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
27
+ }],
28
+ '@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
29
+ '@atlaskit/design-system/no-legacy-icons': 'warn',
30
+ '@atlaskit/design-system/no-margin': 'warn',
31
+ '@atlaskit/design-system/no-nested-styles': 'error',
32
+ '@atlaskit/design-system/no-physical-properties': 'error',
33
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
34
+ '@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
35
+ '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
36
+ '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
37
+ '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
38
+ '@atlaskit/design-system/prefer-primitives': 'warn',
39
+ '@atlaskit/design-system/use-button-group-label': 'warn',
40
+ '@atlaskit/design-system/use-drawer-label': 'warn',
41
+ '@atlaskit/design-system/use-heading': 'warn',
42
+ '@atlaskit/design-system/use-heading-level-in-spotlight-card': 'warn',
43
+ '@atlaskit/design-system/use-href-in-link-item': 'warn',
44
+ '@atlaskit/design-system/use-latest-xcss-syntax': 'error',
45
+ '@atlaskit/design-system/use-latest-xcss-syntax-typography': 'warn',
46
+ '@atlaskit/design-system/use-menu-section-title': 'warn',
47
+ '@atlaskit/design-system/use-popup-label': 'warn',
48
+ '@atlaskit/design-system/use-primitives': 'warn',
49
+ '@atlaskit/design-system/use-primitives-text': 'warn',
50
+ '@atlaskit/design-system/use-tag-group-label': 'warn',
51
+ '@atlaskit/design-system/use-tokens-space': 'error',
52
+ '@atlaskit/design-system/use-tokens-typography': 'warn',
53
+ '@atlaskit/design-system/use-visually-hidden': 'error'
54
+ }
55
+ };
@@ -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::310e184a1b8eca0da1246cfe8d128e2c>>
3
+ * @codegen <<SignedSource::47f018ad98455be31dc522bcf5360adf>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  export default {
@@ -29,6 +29,7 @@ export default {
29
29
  '@atlaskit/design-system/no-margin': 'warn',
30
30
  '@atlaskit/design-system/no-nested-styles': 'error',
31
31
  '@atlaskit/design-system/no-physical-properties': 'error',
32
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
32
33
  '@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
33
34
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
34
35
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
@@ -0,0 +1,39 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ * @codegen <<SignedSource::9c6dda34a88386c4fa5b931ab4baf929>>
4
+ * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
+ */
6
+ export default {
7
+ // NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
8
+ plugins: {},
9
+ rules: {
10
+ '@atlaskit/design-system/consistent-css-prop-usage': 'error',
11
+ '@atlaskit/design-system/ensure-design-token-usage': 'error',
12
+ '@atlaskit/design-system/icon-label': 'warn',
13
+ '@atlaskit/design-system/no-banned-imports': 'error',
14
+ '@atlaskit/design-system/no-deprecated-apis': 'error',
15
+ '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
16
+ '@atlaskit/design-system/no-deprecated-imports': 'error',
17
+ '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': 'error',
18
+ '@atlaskit/design-system/no-html-anchor': 'warn',
19
+ '@atlaskit/design-system/no-html-button': 'warn',
20
+ '@atlaskit/design-system/no-invalid-css-map': ['error', {
21
+ allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
22
+ }],
23
+ '@atlaskit/design-system/no-nested-styles': 'error',
24
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
25
+ '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
26
+ '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
27
+ '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
28
+ '@atlaskit/design-system/use-button-group-label': 'warn',
29
+ '@atlaskit/design-system/use-drawer-label': 'warn',
30
+ '@atlaskit/design-system/use-heading-level-in-spotlight-card': 'warn',
31
+ '@atlaskit/design-system/use-href-in-link-item': 'warn',
32
+ '@atlaskit/design-system/use-latest-xcss-syntax': 'error',
33
+ '@atlaskit/design-system/use-latest-xcss-syntax-typography': 'warn',
34
+ '@atlaskit/design-system/use-menu-section-title': 'warn',
35
+ '@atlaskit/design-system/use-popup-label': 'warn',
36
+ '@atlaskit/design-system/use-tag-group-label': 'warn',
37
+ '@atlaskit/design-system/use-visually-hidden': 'error'
38
+ }
39
+ };
@@ -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::9be7e90918082d78473f5d2a2271b15c>>
3
+ * @codegen <<SignedSource::f1b4aa9e656294739485e62ba4a33f9d>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  export default {
@@ -20,6 +20,7 @@ export default {
20
20
  allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
21
21
  }],
22
22
  '@atlaskit/design-system/no-nested-styles': 'error',
23
+ '@atlaskit/design-system/no-separator-with-list-elements': 'warn',
23
24
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
24
25
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
25
26
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
@@ -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::2c61c8c9aa86b4fb1d11e0bcba9d83a1>>
3
+ * @codegen <<SignedSource::2ab06b34c4e08cd70b0f67f5915f12c9>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import consistentCssPropUsage from './consistent-css-prop-usage';
@@ -27,6 +27,7 @@ import noLegacyIcons from './no-legacy-icons';
27
27
  import noMargin from './no-margin';
28
28
  import noNestedStyles from './no-nested-styles';
29
29
  import noPhysicalProperties from './no-physical-properties';
30
+ import noSeparatorWithListElements from './no-separator-with-list-elements';
30
31
  import noStyledTaggedTemplateExpression from './no-styled-tagged-template-expression';
31
32
  import noUnsafeDesignTokenUsage from './no-unsafe-design-token-usage';
32
33
  import noUnsafeStyleOverrides from './no-unsafe-style-overrides';
@@ -47,7 +48,7 @@ import useTagGroupLabel from './use-tag-group-label';
47
48
  import useTokensSpace from './use-tokens-space';
48
49
  import useTokensTypography from './use-tokens-typography';
49
50
  import useVisuallyHidden from './use-visually-hidden';
50
- export default {
51
+ export const rules = {
51
52
  'consistent-css-prop-usage': consistentCssPropUsage,
52
53
  'ensure-design-token-usage': ensureDesignTokenUsage,
53
54
  'ensure-design-token-usage/preview': ensureDesignTokenUsagePreview,
@@ -72,6 +73,7 @@ export default {
72
73
  'no-margin': noMargin,
73
74
  'no-nested-styles': noNestedStyles,
74
75
  'no-physical-properties': noPhysicalProperties,
76
+ 'no-separator-with-list-elements': noSeparatorWithListElements,
75
77
  'no-styled-tagged-template-expression': noStyledTaggedTemplateExpression,
76
78
  'no-unsafe-design-token-usage': noUnsafeDesignTokenUsage,
77
79
  'no-unsafe-style-overrides': noUnsafeStyleOverrides,