@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.
Files changed (49) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +10 -7
  3. package/constellation/atlaskit-theme/usage.mdx +113 -0
  4. package/constellation/convert-props-syntax/usage.mdx +32 -22
  5. package/constellation/enforce-style-prop/usage.mdx +21 -18
  6. package/constellation/index/overview.mdx +91 -76
  7. package/constellation/local-cx-xcss/usage.mdx +10 -6
  8. package/constellation/no-array-arguments/usage.mdx +10 -9
  9. package/constellation/no-classname-prop/usage.mdx +7 -4
  10. package/constellation/no-container-queries/usage.mdx +17 -15
  11. package/constellation/no-dynamic-styles/usage.mdx +26 -29
  12. package/constellation/no-exported-styles/usage.mdx +23 -18
  13. package/constellation/no-important-styles/usage.mdx +5 -3
  14. package/constellation/no-imported-style-values/usage.mdx +30 -22
  15. package/constellation/no-nested-selectors/usage.mdx +22 -20
  16. package/constellation/no-unsafe-values/usage.mdx +45 -51
  17. package/dist/cjs/index.codegen.js +1 -1
  18. package/dist/cjs/presets/all.codegen.js +2 -1
  19. package/dist/cjs/presets/recommended.codegen.js +2 -1
  20. package/dist/cjs/rules/atlaskit-theme/index.js +95 -0
  21. package/dist/cjs/rules/index.codegen.js +3 -1
  22. package/dist/es2019/index.codegen.js +1 -1
  23. package/dist/es2019/presets/all.codegen.js +2 -1
  24. package/dist/es2019/presets/recommended.codegen.js +2 -1
  25. package/dist/es2019/rules/atlaskit-theme/index.js +85 -0
  26. package/dist/es2019/rules/index.codegen.js +3 -1
  27. package/dist/esm/index.codegen.js +1 -1
  28. package/dist/esm/presets/all.codegen.js +2 -1
  29. package/dist/esm/presets/recommended.codegen.js +2 -1
  30. package/dist/esm/rules/atlaskit-theme/index.js +89 -0
  31. package/dist/esm/rules/index.codegen.js +3 -1
  32. package/dist/types/index.codegen.d.ts +2 -0
  33. package/dist/types/presets/all.codegen.d.ts +2 -1
  34. package/dist/types/presets/recommended.codegen.d.ts +2 -1
  35. package/dist/types/rules/atlaskit-theme/index.d.ts +3 -0
  36. package/dist/types/rules/index.codegen.d.ts +1 -0
  37. package/dist/types-ts4.5/index.codegen.d.ts +2 -0
  38. package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -1
  39. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +2 -1
  40. package/dist/types-ts4.5/rules/atlaskit-theme/index.d.ts +3 -0
  41. package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -0
  42. package/package.json +2 -2
  43. package/src/index.codegen.tsx +3 -3
  44. package/src/presets/all.codegen.tsx +66 -69
  45. package/src/presets/recommended.codegen.tsx +66 -69
  46. package/src/rules/atlaskit-theme/README.md +109 -0
  47. package/src/rules/atlaskit-theme/__tests__/test.ts +122 -0
  48. package/src/rules/atlaskit-theme/index.ts +136 -0
  49. 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::648acb81f0f43d8ce56f7d6c22db8856>>
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::96336e6094dbcbf456aaef313b624fbf>>
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::96336e6094dbcbf456aaef313b624fbf>>
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;
@@ -0,0 +1,3 @@
1
+ import type { Rule } from 'eslint';
2
+ export declare const rule: Rule.RuleModule;
3
+ export default rule;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'atlaskit-theme': import("eslint").Rule.RuleModule;
2
3
  'convert-props-syntax': import("eslint").Rule.RuleModule;
3
4
  'enforce-style-prop': import("eslint").Rule.RuleModule;
4
5
  'local-cx-xcss': import("eslint").Rule.RuleModule;
@@ -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::96336e6094dbcbf456aaef313b624fbf>>
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::96336e6094dbcbf456aaef313b624fbf>>
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;
@@ -0,0 +1,3 @@
1
+ import type { Rule } from 'eslint';
2
+ export declare const rule: Rule.RuleModule;
3
+ export default rule;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ 'atlaskit-theme': import("eslint").Rule.RuleModule;
2
3
  'convert-props-syntax': import("eslint").Rule.RuleModule;
3
4
  'enforce-style-prop': import("eslint").Rule.RuleModule;
4
5
  'local-cx-xcss': import("eslint").Rule.RuleModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-ui-styling-standard",
3
- "version": "0.11.5",
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": "^9.7.0",
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",
@@ -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::3fd41935576c9346ca1f1e0c787a0a48>>
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
- all,
13
- recommended,
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::96336e6094dbcbf456aaef313b624fbf>>
3
+ * @codegen <<SignedSource::a0c326baf3aa4e87ac809b303ba34682>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  export default {
7
- plugins: [
8
- '@atlaskit/ui-styling-standard',
9
- '@atlaskit/design-system',
10
- '@compiled',
11
- ],
12
- rules: {
13
- '@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
14
- '@atlaskit/ui-styling-standard/enforce-style-prop': 'warn',
15
- '@atlaskit/ui-styling-standard/local-cx-xcss': 'warn',
16
- '@atlaskit/ui-styling-standard/no-array-arguments': 'warn',
17
- '@atlaskit/ui-styling-standard/no-classname-prop': 'warn',
18
- '@atlaskit/ui-styling-standard/no-container-queries': 'warn',
19
- '@atlaskit/ui-styling-standard/no-dynamic-styles': 'warn',
20
- '@atlaskit/ui-styling-standard/no-exported-styles': 'warn',
21
- '@atlaskit/ui-styling-standard/no-important-styles': 'warn',
22
- '@atlaskit/ui-styling-standard/no-imported-style-values': 'warn',
23
- '@atlaskit/ui-styling-standard/no-nested-selectors': 'warn',
24
- '@atlaskit/ui-styling-standard/no-unsafe-values': 'warn',
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
- '@atlaskit/design-system/no-exported-css': [
48
- 'warn',
49
- {
50
- importSources: [
51
- '@compiled/react',
52
- '@atlaskit/css',
53
- '@emotion/core',
54
- '@emotion/react',
55
- '@emotion/styled',
56
- 'styled-components',
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
- '@atlaskit/design-system/no-exported-keyframes': [
61
- 'warn',
62
- {
63
- importSources: [
64
- '@compiled/react',
65
- '@atlaskit/css',
66
- '@emotion/core',
67
- '@emotion/react',
68
- '@emotion/styled',
69
- 'styled-components',
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
- '@atlaskit/design-system/no-invalid-css-map': [
74
- 'warn',
75
- { allowedFunctionCalls: [['@atlaskit/tokens', 'token']] },
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::96336e6094dbcbf456aaef313b624fbf>>
3
+ * @codegen <<SignedSource::a0c326baf3aa4e87ac809b303ba34682>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  export default {
7
- plugins: [
8
- '@atlaskit/ui-styling-standard',
9
- '@atlaskit/design-system',
10
- '@compiled',
11
- ],
12
- rules: {
13
- '@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
14
- '@atlaskit/ui-styling-standard/enforce-style-prop': 'warn',
15
- '@atlaskit/ui-styling-standard/local-cx-xcss': 'warn',
16
- '@atlaskit/ui-styling-standard/no-array-arguments': 'warn',
17
- '@atlaskit/ui-styling-standard/no-classname-prop': 'warn',
18
- '@atlaskit/ui-styling-standard/no-container-queries': 'warn',
19
- '@atlaskit/ui-styling-standard/no-dynamic-styles': 'warn',
20
- '@atlaskit/ui-styling-standard/no-exported-styles': 'warn',
21
- '@atlaskit/ui-styling-standard/no-important-styles': 'warn',
22
- '@atlaskit/ui-styling-standard/no-imported-style-values': 'warn',
23
- '@atlaskit/ui-styling-standard/no-nested-selectors': 'warn',
24
- '@atlaskit/ui-styling-standard/no-unsafe-values': 'warn',
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
- '@atlaskit/design-system/no-exported-css': [
48
- 'warn',
49
- {
50
- importSources: [
51
- '@compiled/react',
52
- '@atlaskit/css',
53
- '@emotion/core',
54
- '@emotion/react',
55
- '@emotion/styled',
56
- 'styled-components',
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
- '@atlaskit/design-system/no-exported-keyframes': [
61
- 'warn',
62
- {
63
- importSources: [
64
- '@compiled/react',
65
- '@atlaskit/css',
66
- '@emotion/core',
67
- '@emotion/react',
68
- '@emotion/styled',
69
- 'styled-components',
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
- '@atlaskit/design-system/no-invalid-css-map': [
74
- 'warn',
75
- { allowedFunctionCalls: [['@atlaskit/tokens', 'token']] },
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
+ ```