@atlaskit/eslint-plugin-ui-styling-standard 0.11.5 β 0.11.6
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 +8 -0
- package/README.md +10 -7
- package/constellation/atlaskit-theme/usage.mdx +113 -0
- package/constellation/convert-props-syntax/usage.mdx +32 -22
- package/constellation/enforce-style-prop/usage.mdx +21 -18
- package/constellation/index/overview.mdx +91 -76
- package/constellation/local-cx-xcss/usage.mdx +10 -6
- package/constellation/no-array-arguments/usage.mdx +10 -9
- package/constellation/no-classname-prop/usage.mdx +7 -4
- package/constellation/no-container-queries/usage.mdx +17 -15
- package/constellation/no-dynamic-styles/usage.mdx +26 -29
- package/constellation/no-exported-styles/usage.mdx +23 -18
- package/constellation/no-important-styles/usage.mdx +5 -3
- package/constellation/no-imported-style-values/usage.mdx +30 -22
- package/constellation/no-nested-selectors/usage.mdx +22 -20
- package/constellation/no-unsafe-values/usage.mdx +45 -51
- package/dist/cjs/index.codegen.js +1 -1
- package/dist/cjs/presets/all.codegen.js +2 -1
- package/dist/cjs/presets/recommended.codegen.js +2 -1
- package/dist/cjs/rules/atlaskit-theme/index.js +95 -0
- package/dist/cjs/rules/index.codegen.js +3 -1
- package/dist/es2019/index.codegen.js +1 -1
- package/dist/es2019/presets/all.codegen.js +2 -1
- package/dist/es2019/presets/recommended.codegen.js +2 -1
- package/dist/es2019/rules/atlaskit-theme/index.js +85 -0
- package/dist/es2019/rules/index.codegen.js +3 -1
- package/dist/esm/index.codegen.js +1 -1
- package/dist/esm/presets/all.codegen.js +2 -1
- package/dist/esm/presets/recommended.codegen.js +2 -1
- package/dist/esm/rules/atlaskit-theme/index.js +89 -0
- package/dist/esm/rules/index.codegen.js +3 -1
- package/dist/types/index.codegen.d.ts +2 -0
- package/dist/types/presets/all.codegen.d.ts +2 -1
- package/dist/types/presets/recommended.codegen.d.ts +2 -1
- package/dist/types/rules/atlaskit-theme/index.d.ts +3 -0
- package/dist/types/rules/index.codegen.d.ts +1 -0
- package/dist/types-ts4.5/index.codegen.d.ts +2 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -1
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +2 -1
- package/dist/types-ts4.5/rules/atlaskit-theme/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -0
- package/package.json +2 -2
- package/src/index.codegen.tsx +3 -3
- package/src/presets/all.codegen.tsx +66 -69
- package/src/presets/recommended.codegen.tsx +66 -69
- package/src/rules/atlaskit-theme/README.md +109 -0
- package/src/rules/atlaskit-theme/__tests__/test.ts +122 -0
- package/src/rules/atlaskit-theme/index.ts +136 -0
- package/src/rules/index.codegen.tsx +15 -13
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::78ffc29d20fd2fe3727a620cb4ddf192>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
|
+
import atlaskitTheme from './atlaskit-theme';
|
|
6
7
|
import convertPropsSyntax from './convert-props-syntax';
|
|
7
8
|
import enforceStyleProp from './enforce-style-prop';
|
|
8
9
|
import localCxXcss from './local-cx-xcss';
|
|
@@ -16,6 +17,7 @@ import noImportedStyleValues from './no-imported-style-values';
|
|
|
16
17
|
import noNestedSelectors from './no-nested-selectors';
|
|
17
18
|
import noUnsafeValues from './no-unsafe-values';
|
|
18
19
|
export default {
|
|
20
|
+
'atlaskit-theme': atlaskitTheme,
|
|
19
21
|
'convert-props-syntax': convertPropsSyntax,
|
|
20
22
|
'enforce-style-prop': enforceStyleProp,
|
|
21
23
|
'local-cx-xcss': localCxXcss,
|
|
@@ -3,6 +3,7 @@ export declare const configs: {
|
|
|
3
3
|
all: {
|
|
4
4
|
plugins: string[];
|
|
5
5
|
rules: {
|
|
6
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
6
7
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
7
8
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
8
9
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
@@ -40,6 +41,7 @@ export declare const configs: {
|
|
|
40
41
|
recommended: {
|
|
41
42
|
plugins: string[];
|
|
42
43
|
rules: {
|
|
44
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
43
45
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
44
46
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
45
47
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
@@ -1,11 +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::a0c326baf3aa4e87ac809b303ba34682>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
7
7
|
plugins: string[];
|
|
8
8
|
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
9
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
10
11
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
11
12
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
@@ -1,11 +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::a0c326baf3aa4e87ac809b303ba34682>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
7
7
|
plugins: string[];
|
|
8
8
|
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
9
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
10
11
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
11
12
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
@@ -3,6 +3,7 @@ export declare const configs: {
|
|
|
3
3
|
all: {
|
|
4
4
|
plugins: string[];
|
|
5
5
|
rules: {
|
|
6
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
6
7
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
7
8
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
8
9
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
@@ -40,6 +41,7 @@ export declare const configs: {
|
|
|
40
41
|
recommended: {
|
|
41
42
|
plugins: string[];
|
|
42
43
|
rules: {
|
|
44
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
43
45
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
44
46
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
45
47
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
@@ -1,11 +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::a0c326baf3aa4e87ac809b303ba34682>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
7
7
|
plugins: string[];
|
|
8
8
|
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
9
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
10
11
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
11
12
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
@@ -1,11 +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::a0c326baf3aa4e87ac809b303ba34682>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
7
7
|
plugins: string[];
|
|
8
8
|
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': string;
|
|
9
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': string;
|
|
10
11
|
'@atlaskit/ui-styling-standard/enforce-style-prop': string;
|
|
11
12
|
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-ui-styling-standard",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"author": "Atlassian Pty Ltd",
|
|
5
5
|
"description": "The eslint plugin to enforce and educate on Atlassian's UI Styling Standard",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@af/formatting": "*",
|
|
53
53
|
"@atlaskit/ds-lib": "^2.3.0",
|
|
54
|
-
"@atlaskit/eslint-plugin-design-system": "^
|
|
54
|
+
"@atlaskit/eslint-plugin-design-system": "^10.0.0",
|
|
55
55
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
56
56
|
"@atlassian/codegen": "*",
|
|
57
57
|
"@compiled/eslint-plugin": "^0.13.6",
|
package/src/index.codegen.tsx
CHANGED
|
@@ -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::16a3441765e5a97f9f32de7fd0de17f0>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
import all from './presets/all.codegen';
|
|
@@ -9,6 +9,6 @@ import recommended from './presets/recommended.codegen';
|
|
|
9
9
|
export { default as rules } from './rules/index.codegen';
|
|
10
10
|
|
|
11
11
|
export const configs = {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
all,
|
|
13
|
+
recommended,
|
|
14
14
|
};
|
|
@@ -1,78 +1,75 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::a0c326baf3aa4e87ac809b303ba34682>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'@atlaskit/design-system/consistent-css-prop-usage': [
|
|
26
|
-
'warn',
|
|
27
|
-
{ excludeReactComponents: true },
|
|
28
|
-
],
|
|
29
|
-
'@atlaskit/design-system/no-css-tagged-template-expression': 'warn',
|
|
30
|
-
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'warn',
|
|
31
|
-
'@atlaskit/design-system/no-styled-tagged-template-expression': 'warn',
|
|
32
|
-
'@compiled/no-suppress-xcss': 'warn',
|
|
33
|
-
'@compiled/no-js-xcss': 'warn',
|
|
34
|
-
'@atlaskit/design-system/no-empty-styled-expression': [
|
|
35
|
-
'warn',
|
|
36
|
-
{
|
|
37
|
-
importSources: [
|
|
38
|
-
'@compiled/react',
|
|
39
|
-
'@atlaskit/css',
|
|
40
|
-
'@emotion/core',
|
|
41
|
-
'@emotion/react',
|
|
42
|
-
'@emotion/styled',
|
|
43
|
-
'styled-components',
|
|
7
|
+
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system', '@compiled'],
|
|
8
|
+
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
10
|
+
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
11
|
+
'@atlaskit/ui-styling-standard/enforce-style-prop': 'warn',
|
|
12
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': 'warn',
|
|
13
|
+
'@atlaskit/ui-styling-standard/no-array-arguments': 'warn',
|
|
14
|
+
'@atlaskit/ui-styling-standard/no-classname-prop': 'warn',
|
|
15
|
+
'@atlaskit/ui-styling-standard/no-container-queries': 'warn',
|
|
16
|
+
'@atlaskit/ui-styling-standard/no-dynamic-styles': 'warn',
|
|
17
|
+
'@atlaskit/ui-styling-standard/no-exported-styles': 'warn',
|
|
18
|
+
'@atlaskit/ui-styling-standard/no-important-styles': 'warn',
|
|
19
|
+
'@atlaskit/ui-styling-standard/no-imported-style-values': 'warn',
|
|
20
|
+
'@atlaskit/ui-styling-standard/no-nested-selectors': 'warn',
|
|
21
|
+
'@atlaskit/ui-styling-standard/no-unsafe-values': 'warn',
|
|
22
|
+
'@atlaskit/design-system/consistent-css-prop-usage': [
|
|
23
|
+
'warn',
|
|
24
|
+
{ excludeReactComponents: true },
|
|
44
25
|
],
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
26
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': 'warn',
|
|
27
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'warn',
|
|
28
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': 'warn',
|
|
29
|
+
'@compiled/no-suppress-xcss': 'warn',
|
|
30
|
+
'@compiled/no-js-xcss': 'warn',
|
|
31
|
+
'@atlaskit/design-system/no-empty-styled-expression': [
|
|
32
|
+
'warn',
|
|
33
|
+
{
|
|
34
|
+
importSources: [
|
|
35
|
+
'@compiled/react',
|
|
36
|
+
'@atlaskit/css',
|
|
37
|
+
'@emotion/core',
|
|
38
|
+
'@emotion/react',
|
|
39
|
+
'@emotion/styled',
|
|
40
|
+
'styled-components',
|
|
41
|
+
],
|
|
42
|
+
},
|
|
57
43
|
],
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
44
|
+
'@atlaskit/design-system/no-exported-css': [
|
|
45
|
+
'warn',
|
|
46
|
+
{
|
|
47
|
+
importSources: [
|
|
48
|
+
'@compiled/react',
|
|
49
|
+
'@atlaskit/css',
|
|
50
|
+
'@emotion/core',
|
|
51
|
+
'@emotion/react',
|
|
52
|
+
'@emotion/styled',
|
|
53
|
+
'styled-components',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
70
56
|
],
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
57
|
+
'@atlaskit/design-system/no-exported-keyframes': [
|
|
58
|
+
'warn',
|
|
59
|
+
{
|
|
60
|
+
importSources: [
|
|
61
|
+
'@compiled/react',
|
|
62
|
+
'@atlaskit/css',
|
|
63
|
+
'@emotion/core',
|
|
64
|
+
'@emotion/react',
|
|
65
|
+
'@emotion/styled',
|
|
66
|
+
'styled-components',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
'@atlaskit/design-system/no-invalid-css-map': [
|
|
71
|
+
'warn',
|
|
72
|
+
{ allowedFunctionCalls: [['@atlaskit/tokens', 'token']] },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
78
75
|
};
|
|
@@ -1,78 +1,75 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::a0c326baf3aa4e87ac809b303ba34682>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'@atlaskit/design-system/consistent-css-prop-usage': [
|
|
26
|
-
'warn',
|
|
27
|
-
{ excludeReactComponents: true },
|
|
28
|
-
],
|
|
29
|
-
'@atlaskit/design-system/no-css-tagged-template-expression': 'warn',
|
|
30
|
-
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'warn',
|
|
31
|
-
'@atlaskit/design-system/no-styled-tagged-template-expression': 'warn',
|
|
32
|
-
'@compiled/no-suppress-xcss': 'warn',
|
|
33
|
-
'@compiled/no-js-xcss': 'warn',
|
|
34
|
-
'@atlaskit/design-system/no-empty-styled-expression': [
|
|
35
|
-
'warn',
|
|
36
|
-
{
|
|
37
|
-
importSources: [
|
|
38
|
-
'@compiled/react',
|
|
39
|
-
'@atlaskit/css',
|
|
40
|
-
'@emotion/core',
|
|
41
|
-
'@emotion/react',
|
|
42
|
-
'@emotion/styled',
|
|
43
|
-
'styled-components',
|
|
7
|
+
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system', '@compiled'],
|
|
8
|
+
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
10
|
+
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
11
|
+
'@atlaskit/ui-styling-standard/enforce-style-prop': 'warn',
|
|
12
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': 'warn',
|
|
13
|
+
'@atlaskit/ui-styling-standard/no-array-arguments': 'warn',
|
|
14
|
+
'@atlaskit/ui-styling-standard/no-classname-prop': 'warn',
|
|
15
|
+
'@atlaskit/ui-styling-standard/no-container-queries': 'warn',
|
|
16
|
+
'@atlaskit/ui-styling-standard/no-dynamic-styles': 'warn',
|
|
17
|
+
'@atlaskit/ui-styling-standard/no-exported-styles': 'warn',
|
|
18
|
+
'@atlaskit/ui-styling-standard/no-important-styles': 'warn',
|
|
19
|
+
'@atlaskit/ui-styling-standard/no-imported-style-values': 'warn',
|
|
20
|
+
'@atlaskit/ui-styling-standard/no-nested-selectors': 'warn',
|
|
21
|
+
'@atlaskit/ui-styling-standard/no-unsafe-values': 'warn',
|
|
22
|
+
'@atlaskit/design-system/consistent-css-prop-usage': [
|
|
23
|
+
'warn',
|
|
24
|
+
{ excludeReactComponents: true },
|
|
44
25
|
],
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
26
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': 'warn',
|
|
27
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'warn',
|
|
28
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': 'warn',
|
|
29
|
+
'@compiled/no-suppress-xcss': 'warn',
|
|
30
|
+
'@compiled/no-js-xcss': 'warn',
|
|
31
|
+
'@atlaskit/design-system/no-empty-styled-expression': [
|
|
32
|
+
'warn',
|
|
33
|
+
{
|
|
34
|
+
importSources: [
|
|
35
|
+
'@compiled/react',
|
|
36
|
+
'@atlaskit/css',
|
|
37
|
+
'@emotion/core',
|
|
38
|
+
'@emotion/react',
|
|
39
|
+
'@emotion/styled',
|
|
40
|
+
'styled-components',
|
|
41
|
+
],
|
|
42
|
+
},
|
|
57
43
|
],
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
44
|
+
'@atlaskit/design-system/no-exported-css': [
|
|
45
|
+
'warn',
|
|
46
|
+
{
|
|
47
|
+
importSources: [
|
|
48
|
+
'@compiled/react',
|
|
49
|
+
'@atlaskit/css',
|
|
50
|
+
'@emotion/core',
|
|
51
|
+
'@emotion/react',
|
|
52
|
+
'@emotion/styled',
|
|
53
|
+
'styled-components',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
70
56
|
],
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
57
|
+
'@atlaskit/design-system/no-exported-keyframes': [
|
|
58
|
+
'warn',
|
|
59
|
+
{
|
|
60
|
+
importSources: [
|
|
61
|
+
'@compiled/react',
|
|
62
|
+
'@atlaskit/css',
|
|
63
|
+
'@emotion/core',
|
|
64
|
+
'@emotion/react',
|
|
65
|
+
'@emotion/styled',
|
|
66
|
+
'styled-components',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
'@atlaskit/design-system/no-invalid-css-map': [
|
|
71
|
+
'warn',
|
|
72
|
+
{ allowedFunctionCalls: [['@atlaskit/tokens', 'token']] },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
78
75
|
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
This rule bans certain usages of `@atlaskit/theme` that `@compiled/react` is unable to compile. This includes `typography`, `elevation` and `skeletonShimmer`.
|
|
2
|
+
|
|
3
|
+
## Examples
|
|
4
|
+
|
|
5
|
+
### Typography
|
|
6
|
+
|
|
7
|
+
Use `<Heading>` instead of `typography`.
|
|
8
|
+
|
|
9
|
+
π Example of **incorrect** code for this rule:
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { styled } from '@compiled/react';
|
|
13
|
+
import { typography } from '@atlaskit/theme';
|
|
14
|
+
|
|
15
|
+
export const HeadingComponent = styled.h2`
|
|
16
|
+
${typography.h200()};
|
|
17
|
+
`;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { styled } from '@compiled/react';
|
|
22
|
+
import { typography } from '@atlaskit/theme';
|
|
23
|
+
|
|
24
|
+
export const HeadingComponent = styled.h2(typography.h200());
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
π Example of **correct** code for this rule:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { styled } from '@compiled/react';
|
|
31
|
+
|
|
32
|
+
const HeadingComponent = styled.h2({
|
|
33
|
+
fontSize: '20px',
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import Heading from '@atlaskit/heading';
|
|
39
|
+
import { token } from '@atlaskit/tokens';
|
|
40
|
+
import { styled } from '@compiled/react';
|
|
41
|
+
|
|
42
|
+
const TitleComponent = styled.span({
|
|
43
|
+
marginTop: token('space.150', '12px'),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const Title = (props) => (
|
|
47
|
+
<Heading level="h200" as="h3">
|
|
48
|
+
<TitleComponent {...props} />
|
|
49
|
+
</Heading>
|
|
50
|
+
);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Elevation
|
|
54
|
+
|
|
55
|
+
We donβt support this mixin, please use tokens instead.
|
|
56
|
+
|
|
57
|
+
π Example of **incorrect** code for this rule:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { styled } from '@compiled/react';
|
|
61
|
+
import { elevation } from '@atlaskit/theme';
|
|
62
|
+
|
|
63
|
+
export const ElevationComponent = styled.div`
|
|
64
|
+
${elevation.e100()};
|
|
65
|
+
`;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
π Example of **correct** code for this rule:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import { styled } from '@compiled/react';
|
|
72
|
+
import { token } from '@atlaskit/tokens';
|
|
73
|
+
|
|
74
|
+
export const TestComponent = styled.div({
|
|
75
|
+
boxShadow: token(
|
|
76
|
+
'elevation.shadow.raised',
|
|
77
|
+
'0 1px 1px rgba(9,30,66,0.25),0 0 1px 1px rgba(9,30,66,0.13)',
|
|
78
|
+
),
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Skeleton Shimmer
|
|
83
|
+
|
|
84
|
+
You can preview our `@atlaskit/skeleton` (docs available to internal Atlassians only: [link](https://staging.atlassian.design/components/skeleton/examples)).
|
|
85
|
+
|
|
86
|
+
Otherwise, please use an SVG skeleton or your own `@compiled/react` variant yourself.
|
|
87
|
+
|
|
88
|
+
π Example of **incorrect** code for this rule:
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { styled } from '@compiled/react';
|
|
92
|
+
import { skeletonShimmer } from '@atlaskit/theme/constants';
|
|
93
|
+
|
|
94
|
+
export const SkeletonShimmerComponent = styled.div`
|
|
95
|
+
${skeletonShimmer};
|
|
96
|
+
`;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
π Example of **correct** code for this rule:
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
export const SkeletonShimmerComponent = () => {
|
|
103
|
+
return (
|
|
104
|
+
<Wrapper>
|
|
105
|
+
<object data="./skeleton.svg" type="image/svg+xml"></object>
|
|
106
|
+
</Wrapper>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
```
|