@atlaskit/eslint-plugin-design-system 8.30.0 → 8.31.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.
- package/CHANGELOG.md +6 -0
- package/README.md +0 -1
- package/configs/deprecated.json +0 -5
- package/constellation/index/usage.mdx +0 -1
- package/dist/cjs/presets/all.codegen.js +1 -2
- package/dist/cjs/presets/recommended.codegen.js +1 -2
- package/dist/cjs/rules/index.codegen.js +1 -3
- package/dist/configs/deprecated.json +0 -5
- package/dist/es2019/presets/all.codegen.js +1 -2
- package/dist/es2019/presets/recommended.codegen.js +1 -2
- package/dist/es2019/rules/index.codegen.js +1 -3
- package/dist/esm/presets/all.codegen.js +1 -2
- package/dist/esm/presets/recommended.codegen.js +1 -2
- package/dist/esm/rules/index.codegen.js +1 -3
- package/dist/types/index.codegen.d.ts +0 -2
- package/dist/types/presets/all.codegen.d.ts +1 -2
- package/dist/types/presets/recommended.codegen.d.ts +1 -2
- package/dist/types/rules/index.codegen.d.ts +0 -1
- package/dist/types-ts4.5/index.codegen.d.ts +0 -2
- package/dist/types-ts4.5/presets/all.codegen.d.ts +1 -2
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -2
- package/dist/types-ts4.5/rules/index.codegen.d.ts +0 -1
- package/package.json +1 -1
- package/constellation/local-cx-xcss/usage.mdx +0 -37
- package/dist/cjs/rules/local-cx-xcss/index.js +0 -51
- package/dist/es2019/rules/local-cx-xcss/index.js +0 -45
- package/dist/esm/rules/local-cx-xcss/index.js +0 -45
- package/dist/types/rules/local-cx-xcss/index.d.ts +0 -3
- package/dist/types-ts4.5/rules/local-cx-xcss/index.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 8.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#75600](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75600) [`6259d0d74690`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6259d0d74690) - Migrates the ESLint rule from `@atlaskit/design-system/local-cx-xcss` to `@atlaskit/ui-styling-standard/local-cx-xcss`—disruption is unexpected as this rule is not in use.
|
|
8
|
+
|
|
3
9
|
## 8.30.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -53,7 +53,6 @@ module.exports = {
|
|
|
53
53
|
| <a href="./src/rules/ensure-design-token-usage/README.md">ensure-design-token-usage</a> | Enforces usage of design tokens rather than hard-coded values. | Yes | Yes | Yes |
|
|
54
54
|
| <a href="./src/rules/ensure-design-token-usage-preview/README.md">ensure-design-token-usage/preview</a> | Enforces usage of pre-release design tokens rather than hard-coded values. | | Yes | Yes |
|
|
55
55
|
| <a href="./src/rules/icon-label/README.md">icon-label</a> | Enforces accessible usage of icon labels when composed with Atlassian Design System components. | Yes | Yes | |
|
|
56
|
-
| <a href="./src/rules/local-cx-xcss/README.md">local-cx-xcss</a> | Ensures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element. | Yes | | |
|
|
57
56
|
| <a href="./src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
|
|
58
57
|
| <a href="./src/rules/no-css-tagged-template-expression/README.md">no-css-tagged-template-expression</a> | Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
|
|
59
58
|
| <a href="./src/rules/no-deprecated-apis/README.md">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
|
package/configs/deprecated.json
CHANGED
|
@@ -15,7 +15,6 @@ This plugin contains rules that should be used when working with the [Atlassian
|
|
|
15
15
|
| <a href="ensure-design-token-usage/usage">ensure-design-token-usage</a> | Enforces usage of design tokens rather than hard-coded values. | Yes | Yes | Yes |
|
|
16
16
|
| <a href="ensure-design-token-usage-preview/usage">ensure-design-token-usage/preview</a> | Enforces usage of pre-release design tokens rather than hard-coded values. | | Yes | Yes |
|
|
17
17
|
| <a href="icon-label/usage">icon-label</a> | Enforces accessible usage of icon labels when composed with Atlassian Design System components. | Yes | Yes | |
|
|
18
|
-
| <a href="local-cx-xcss/usage">local-cx-xcss</a> | Ensures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element. | Yes | | |
|
|
19
18
|
| <a href="no-banned-imports/usage">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
|
|
20
19
|
| <a href="no-css-tagged-template-expression/usage">no-css-tagged-template-expression</a> | Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
|
|
21
20
|
| <a href="no-deprecated-apis/usage">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
|
|
@@ -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::
|
|
9
|
+
* @codegen <<SignedSource::aa64b4343b8763cfa5aa66230faea408>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
var _default = exports.default = {
|
|
@@ -16,7 +16,6 @@ var _default = exports.default = {
|
|
|
16
16
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
17
17
|
'@atlaskit/design-system/ensure-design-token-usage/preview': 'warn',
|
|
18
18
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
19
|
-
'@atlaskit/design-system/local-cx-xcss': 'error',
|
|
20
19
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
21
20
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
22
21
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
@@ -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::
|
|
9
|
+
* @codegen <<SignedSource::aebc778f0b10032cbb2941b55189d766>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
var _default = exports.default = {
|
|
@@ -15,7 +15,6 @@ var _default = exports.default = {
|
|
|
15
15
|
'@atlaskit/design-system/consistent-css-prop-usage': 'error',
|
|
16
16
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
17
17
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
18
|
-
'@atlaskit/design-system/local-cx-xcss': 'error',
|
|
19
18
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
20
19
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
21
20
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -9,7 +9,6 @@ var _consistentCssPropUsage = _interopRequireDefault(require("./consistent-css-p
|
|
|
9
9
|
var _ensureDesignTokenUsage = _interopRequireDefault(require("./ensure-design-token-usage"));
|
|
10
10
|
var _ensureDesignTokenUsagePreview = _interopRequireDefault(require("./ensure-design-token-usage-preview"));
|
|
11
11
|
var _iconLabel = _interopRequireDefault(require("./icon-label"));
|
|
12
|
-
var _localCxXcss = _interopRequireDefault(require("./local-cx-xcss"));
|
|
13
12
|
var _noBannedImports = _interopRequireDefault(require("./no-banned-imports"));
|
|
14
13
|
var _noCssTaggedTemplateExpression = _interopRequireDefault(require("./no-css-tagged-template-expression"));
|
|
15
14
|
var _noDeprecatedApis = _interopRequireDefault(require("./no-deprecated-apis"));
|
|
@@ -37,7 +36,7 @@ var _usePrimitivesText = _interopRequireDefault(require("./use-primitives-text")
|
|
|
37
36
|
var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
|
|
38
37
|
/**
|
|
39
38
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
40
|
-
* @codegen <<SignedSource::
|
|
39
|
+
* @codegen <<SignedSource::7d840a5791dae4a9dfc4dda8ec00dcf9>>
|
|
41
40
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
42
41
|
*/
|
|
43
42
|
var _default = exports.default = {
|
|
@@ -45,7 +44,6 @@ var _default = exports.default = {
|
|
|
45
44
|
'ensure-design-token-usage': _ensureDesignTokenUsage.default,
|
|
46
45
|
'ensure-design-token-usage/preview': _ensureDesignTokenUsagePreview.default,
|
|
47
46
|
'icon-label': _iconLabel.default,
|
|
48
|
-
'local-cx-xcss': _localCxXcss.default,
|
|
49
47
|
'no-banned-imports': _noBannedImports.default,
|
|
50
48
|
'no-css-tagged-template-expression': _noCssTaggedTemplateExpression.default,
|
|
51
49
|
'no-deprecated-apis': _noDeprecatedApis.default,
|
|
@@ -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::
|
|
3
|
+
* @codegen <<SignedSource::aa64b4343b8763cfa5aa66230faea408>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -10,7 +10,6 @@ export default {
|
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
11
11
|
'@atlaskit/design-system/ensure-design-token-usage/preview': 'warn',
|
|
12
12
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
13
|
-
'@atlaskit/design-system/local-cx-xcss': 'error',
|
|
14
13
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
15
14
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
16
15
|
'@atlaskit/design-system/no-deprecated-apis': '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::
|
|
3
|
+
* @codegen <<SignedSource::aebc778f0b10032cbb2941b55189d766>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -9,7 +9,6 @@ export default {
|
|
|
9
9
|
'@atlaskit/design-system/consistent-css-prop-usage': 'error',
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
11
11
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
12
|
-
'@atlaskit/design-system/local-cx-xcss': 'error',
|
|
13
12
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
14
13
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
15
14
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::7d840a5791dae4a9dfc4dda8ec00dcf9>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import consistentCssPropUsage from './consistent-css-prop-usage';
|
|
7
7
|
import ensureDesignTokenUsage from './ensure-design-token-usage';
|
|
8
8
|
import ensureDesignTokenUsagePreview from './ensure-design-token-usage-preview';
|
|
9
9
|
import iconLabel from './icon-label';
|
|
10
|
-
import localCxXcss from './local-cx-xcss';
|
|
11
10
|
import noBannedImports from './no-banned-imports';
|
|
12
11
|
import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
|
|
13
12
|
import noDeprecatedApis from './no-deprecated-apis';
|
|
@@ -38,7 +37,6 @@ export default {
|
|
|
38
37
|
'ensure-design-token-usage': ensureDesignTokenUsage,
|
|
39
38
|
'ensure-design-token-usage/preview': ensureDesignTokenUsagePreview,
|
|
40
39
|
'icon-label': iconLabel,
|
|
41
|
-
'local-cx-xcss': localCxXcss,
|
|
42
40
|
'no-banned-imports': noBannedImports,
|
|
43
41
|
'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
|
|
44
42
|
'no-deprecated-apis': noDeprecatedApis,
|
|
@@ -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::
|
|
3
|
+
* @codegen <<SignedSource::aa64b4343b8763cfa5aa66230faea408>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -10,7 +10,6 @@ export default {
|
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
11
11
|
'@atlaskit/design-system/ensure-design-token-usage/preview': 'warn',
|
|
12
12
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
13
|
-
'@atlaskit/design-system/local-cx-xcss': 'error',
|
|
14
13
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
15
14
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
16
15
|
'@atlaskit/design-system/no-deprecated-apis': '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::
|
|
3
|
+
* @codegen <<SignedSource::aebc778f0b10032cbb2941b55189d766>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -9,7 +9,6 @@ export default {
|
|
|
9
9
|
'@atlaskit/design-system/consistent-css-prop-usage': 'error',
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
11
11
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
12
|
-
'@atlaskit/design-system/local-cx-xcss': 'error',
|
|
13
12
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
14
13
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
15
14
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::7d840a5791dae4a9dfc4dda8ec00dcf9>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import consistentCssPropUsage from './consistent-css-prop-usage';
|
|
7
7
|
import ensureDesignTokenUsage from './ensure-design-token-usage';
|
|
8
8
|
import ensureDesignTokenUsagePreview from './ensure-design-token-usage-preview';
|
|
9
9
|
import iconLabel from './icon-label';
|
|
10
|
-
import localCxXcss from './local-cx-xcss';
|
|
11
10
|
import noBannedImports from './no-banned-imports';
|
|
12
11
|
import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
|
|
13
12
|
import noDeprecatedApis from './no-deprecated-apis';
|
|
@@ -38,7 +37,6 @@ export default {
|
|
|
38
37
|
'ensure-design-token-usage': ensureDesignTokenUsage,
|
|
39
38
|
'ensure-design-token-usage/preview': ensureDesignTokenUsagePreview,
|
|
40
39
|
'icon-label': iconLabel,
|
|
41
|
-
'local-cx-xcss': localCxXcss,
|
|
42
40
|
'no-banned-imports': noBannedImports,
|
|
43
41
|
'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
|
|
44
42
|
'no-deprecated-apis': noDeprecatedApis,
|
|
@@ -7,7 +7,6 @@ export declare const configs: {
|
|
|
7
7
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
8
8
|
'@atlaskit/design-system/ensure-design-token-usage/preview': string;
|
|
9
9
|
'@atlaskit/design-system/icon-label': string;
|
|
10
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
11
10
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
12
11
|
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
13
12
|
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
@@ -41,7 +40,6 @@ export declare const configs: {
|
|
|
41
40
|
'@atlaskit/design-system/consistent-css-prop-usage': string;
|
|
42
41
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
43
42
|
'@atlaskit/design-system/icon-label': string;
|
|
44
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
45
43
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
46
44
|
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
47
45
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 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::
|
|
3
|
+
* @codegen <<SignedSource::aa64b4343b8763cfa5aa66230faea408>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -10,7 +10,6 @@ declare const _default: {
|
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
11
11
|
'@atlaskit/design-system/ensure-design-token-usage/preview': string;
|
|
12
12
|
'@atlaskit/design-system/icon-label': string;
|
|
13
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
14
13
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
15
14
|
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
16
15
|
'@atlaskit/design-system/no-deprecated-apis': 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::
|
|
3
|
+
* @codegen <<SignedSource::aebc778f0b10032cbb2941b55189d766>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -9,7 +9,6 @@ declare const _default: {
|
|
|
9
9
|
'@atlaskit/design-system/consistent-css-prop-usage': string;
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
11
11
|
'@atlaskit/design-system/icon-label': string;
|
|
12
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
13
12
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
14
13
|
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
15
14
|
'@atlaskit/design-system/no-deprecated-design-token-usage': string;
|
|
@@ -3,7 +3,6 @@ declare const _default: {
|
|
|
3
3
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
4
4
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
5
5
|
'icon-label': import("eslint").Rule.RuleModule;
|
|
6
|
-
'local-cx-xcss': import("eslint").Rule.RuleModule;
|
|
7
6
|
'no-banned-imports': import("eslint").Rule.RuleModule;
|
|
8
7
|
'no-css-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
9
8
|
'no-deprecated-apis': import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<string, [{
|
|
@@ -7,7 +7,6 @@ export declare const configs: {
|
|
|
7
7
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
8
8
|
'@atlaskit/design-system/ensure-design-token-usage/preview': string;
|
|
9
9
|
'@atlaskit/design-system/icon-label': string;
|
|
10
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
11
10
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
12
11
|
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
13
12
|
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
@@ -41,7 +40,6 @@ export declare const configs: {
|
|
|
41
40
|
'@atlaskit/design-system/consistent-css-prop-usage': string;
|
|
42
41
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
43
42
|
'@atlaskit/design-system/icon-label': string;
|
|
44
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
45
43
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
46
44
|
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
47
45
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 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::
|
|
3
|
+
* @codegen <<SignedSource::aa64b4343b8763cfa5aa66230faea408>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -10,7 +10,6 @@ declare const _default: {
|
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
11
11
|
'@atlaskit/design-system/ensure-design-token-usage/preview': string;
|
|
12
12
|
'@atlaskit/design-system/icon-label': string;
|
|
13
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
14
13
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
15
14
|
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
16
15
|
'@atlaskit/design-system/no-deprecated-apis': 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::
|
|
3
|
+
* @codegen <<SignedSource::aebc778f0b10032cbb2941b55189d766>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -9,7 +9,6 @@ declare const _default: {
|
|
|
9
9
|
'@atlaskit/design-system/consistent-css-prop-usage': string;
|
|
10
10
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
11
11
|
'@atlaskit/design-system/icon-label': string;
|
|
12
|
-
'@atlaskit/design-system/local-cx-xcss': string;
|
|
13
12
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
14
13
|
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
15
14
|
'@atlaskit/design-system/no-deprecated-design-token-usage': string;
|
|
@@ -3,7 +3,6 @@ declare const _default: {
|
|
|
3
3
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
4
4
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
5
5
|
'icon-label': import("eslint").Rule.RuleModule;
|
|
6
|
-
'local-cx-xcss': import("eslint").Rule.RuleModule;
|
|
7
6
|
'no-banned-imports': import("eslint").Rule.RuleModule;
|
|
8
7
|
'no-css-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
9
8
|
'no-deprecated-apis': import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<string, [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-design-system",
|
|
3
3
|
"description": "The essential plugin for use with the Atlassian Design System.",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.31.0",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# local-cx-xcss
|
|
2
|
-
|
|
3
|
-
This rule ensures the `cx()` function is only used within the `xcss` prop. This aids tracking what styles are applied to a jsx element.
|
|
4
|
-
|
|
5
|
-
The `cx` function is checked only if it is imported from `@compiled/react` or `@atlaskit/css`.
|
|
6
|
-
|
|
7
|
-
Passing arguments to the `cx()` function is how you compose styles (combine more than one set of styles together) with XCSS. This is a workaround for the more conventional array syntax (e.g. [in Emotion](https://emotion.sh/docs/composition)) `<div xcss={[style1, style2]} />` not giving robust enough type checking.
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
### Incorrect
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import { cx, cssMap } from '@compiled/react';
|
|
15
|
-
|
|
16
|
-
const styles = cssMap({
|
|
17
|
-
text: { color: 'red' },
|
|
18
|
-
bg: { background: 'blue' },
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const joinedStyles = cx(styles.text, styles.bg);
|
|
22
|
-
|
|
23
|
-
<Button xcss={joinedStyles} />;
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Correct
|
|
27
|
-
|
|
28
|
-
```js
|
|
29
|
-
import { cx, cssMap } from '@compiled/react';
|
|
30
|
-
|
|
31
|
-
const styles = cssMap({
|
|
32
|
-
text: { color: 'red' },
|
|
33
|
-
bg: { background: 'blue' },
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
<Button xcss={cx(styles.text, styles.bg)} />;
|
|
37
|
-
```
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.rule = exports.default = void 0;
|
|
7
|
-
var _createRule = require("../utils/create-rule");
|
|
8
|
-
var _isSupportedImport = require("../utils/is-supported-import");
|
|
9
|
-
var IMPORT_SOURCES = [_isSupportedImport.CSS_IN_JS_IMPORTS.compiled, _isSupportedImport.CSS_IN_JS_IMPORTS.atlaskitCss];
|
|
10
|
-
function getParentJSXAttribute(node) {
|
|
11
|
-
var parent = node.parent;
|
|
12
|
-
while (parent && parent.type !== 'JSXAttribute') {
|
|
13
|
-
parent = parent.parent;
|
|
14
|
-
}
|
|
15
|
-
if (parent && parent.type === 'JSXAttribute') {
|
|
16
|
-
return parent;
|
|
17
|
-
}
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
21
|
-
meta: {
|
|
22
|
-
name: 'local-cx-xcss',
|
|
23
|
-
docs: {
|
|
24
|
-
description: 'Ensures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element.',
|
|
25
|
-
recommended: true,
|
|
26
|
-
severity: 'error'
|
|
27
|
-
},
|
|
28
|
-
messages: {
|
|
29
|
-
'local-cx-xcss': 'The cx function should only be declared inside the xcss prop to simplify tracking styles that are applied to a jsx element.'
|
|
30
|
-
},
|
|
31
|
-
type: 'problem'
|
|
32
|
-
},
|
|
33
|
-
create: function create(context) {
|
|
34
|
-
return {
|
|
35
|
-
'CallExpression[callee.name="cx"]': function CallExpressionCalleeNameCx(node) {
|
|
36
|
-
if (node.type === 'CallExpression' && (0, _isSupportedImport.isCxFunction)(node.callee, context.getScope().references, IMPORT_SOURCES)) {
|
|
37
|
-
var parentJSXAttribute = getParentJSXAttribute(node);
|
|
38
|
-
var propName = parentJSXAttribute === null || parentJSXAttribute === void 0 ? void 0 : parentJSXAttribute.name.name.toString();
|
|
39
|
-
if (propName && /[xX]css$/.test(propName)) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
context.report({
|
|
43
|
-
node: node,
|
|
44
|
-
messageId: 'local-cx-xcss'
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
var _default = exports.default = rule;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { createLintRule } from '../utils/create-rule';
|
|
2
|
-
import { CSS_IN_JS_IMPORTS, isCxFunction } from '../utils/is-supported-import';
|
|
3
|
-
const IMPORT_SOURCES = [CSS_IN_JS_IMPORTS.compiled, CSS_IN_JS_IMPORTS.atlaskitCss];
|
|
4
|
-
function getParentJSXAttribute(node) {
|
|
5
|
-
let parent = node.parent;
|
|
6
|
-
while (parent && parent.type !== 'JSXAttribute') {
|
|
7
|
-
parent = parent.parent;
|
|
8
|
-
}
|
|
9
|
-
if (parent && parent.type === 'JSXAttribute') {
|
|
10
|
-
return parent;
|
|
11
|
-
}
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
export const rule = createLintRule({
|
|
15
|
-
meta: {
|
|
16
|
-
name: 'local-cx-xcss',
|
|
17
|
-
docs: {
|
|
18
|
-
description: 'Ensures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element.',
|
|
19
|
-
recommended: true,
|
|
20
|
-
severity: 'error'
|
|
21
|
-
},
|
|
22
|
-
messages: {
|
|
23
|
-
'local-cx-xcss': 'The cx function should only be declared inside the xcss prop to simplify tracking styles that are applied to a jsx element.'
|
|
24
|
-
},
|
|
25
|
-
type: 'problem'
|
|
26
|
-
},
|
|
27
|
-
create(context) {
|
|
28
|
-
return {
|
|
29
|
-
'CallExpression[callee.name="cx"]': node => {
|
|
30
|
-
if (node.type === 'CallExpression' && isCxFunction(node.callee, context.getScope().references, IMPORT_SOURCES)) {
|
|
31
|
-
const parentJSXAttribute = getParentJSXAttribute(node);
|
|
32
|
-
const propName = parentJSXAttribute === null || parentJSXAttribute === void 0 ? void 0 : parentJSXAttribute.name.name.toString();
|
|
33
|
-
if (propName && /[xX]css$/.test(propName)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
context.report({
|
|
37
|
-
node,
|
|
38
|
-
messageId: 'local-cx-xcss'
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export default rule;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { createLintRule } from '../utils/create-rule';
|
|
2
|
-
import { CSS_IN_JS_IMPORTS, isCxFunction } from '../utils/is-supported-import';
|
|
3
|
-
var IMPORT_SOURCES = [CSS_IN_JS_IMPORTS.compiled, CSS_IN_JS_IMPORTS.atlaskitCss];
|
|
4
|
-
function getParentJSXAttribute(node) {
|
|
5
|
-
var parent = node.parent;
|
|
6
|
-
while (parent && parent.type !== 'JSXAttribute') {
|
|
7
|
-
parent = parent.parent;
|
|
8
|
-
}
|
|
9
|
-
if (parent && parent.type === 'JSXAttribute') {
|
|
10
|
-
return parent;
|
|
11
|
-
}
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
export var rule = createLintRule({
|
|
15
|
-
meta: {
|
|
16
|
-
name: 'local-cx-xcss',
|
|
17
|
-
docs: {
|
|
18
|
-
description: 'Ensures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element.',
|
|
19
|
-
recommended: true,
|
|
20
|
-
severity: 'error'
|
|
21
|
-
},
|
|
22
|
-
messages: {
|
|
23
|
-
'local-cx-xcss': 'The cx function should only be declared inside the xcss prop to simplify tracking styles that are applied to a jsx element.'
|
|
24
|
-
},
|
|
25
|
-
type: 'problem'
|
|
26
|
-
},
|
|
27
|
-
create: function create(context) {
|
|
28
|
-
return {
|
|
29
|
-
'CallExpression[callee.name="cx"]': function CallExpressionCalleeNameCx(node) {
|
|
30
|
-
if (node.type === 'CallExpression' && isCxFunction(node.callee, context.getScope().references, IMPORT_SOURCES)) {
|
|
31
|
-
var parentJSXAttribute = getParentJSXAttribute(node);
|
|
32
|
-
var propName = parentJSXAttribute === null || parentJSXAttribute === void 0 ? void 0 : parentJSXAttribute.name.name.toString();
|
|
33
|
-
if (propName && /[xX]css$/.test(propName)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
context.report({
|
|
37
|
-
node: node,
|
|
38
|
-
messageId: 'local-cx-xcss'
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export default rule;
|