@atlaskit/eslint-plugin-ui-styling-standard 0.17.0 → 0.18.1

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 (152) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/presets/all.codegen.js +3 -2
  3. package/dist/cjs/presets/recommended.codegen.js +3 -2
  4. package/dist/cjs/rules/external-rules.js +3 -1
  5. package/dist/es2019/presets/all.codegen.js +3 -2
  6. package/dist/es2019/presets/recommended.codegen.js +3 -2
  7. package/dist/es2019/rules/external-rules.js +3 -1
  8. package/dist/esm/presets/all.codegen.js +3 -2
  9. package/dist/esm/presets/recommended.codegen.js +3 -2
  10. package/dist/esm/rules/external-rules.js +3 -1
  11. package/dist/types/index.codegen.d.ts +2 -0
  12. package/dist/types/presets/all.codegen.d.ts +2 -1
  13. package/dist/types/presets/recommended.codegen.d.ts +2 -1
  14. package/dist/types-ts4.5/index.codegen.d.ts +2 -0
  15. package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -1
  16. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +2 -1
  17. package/package.json +2 -2
  18. package/afm-cc/tsconfig.json +0 -28
  19. package/afm-jira/tsconfig.json +0 -28
  20. package/build/tsconfig.json +0 -18
  21. package/constellation/atlaskit-theme/usage.mdx +0 -132
  22. package/constellation/consistent-css-prop-usage/usage.mdx +0 -7
  23. package/constellation/convert-props-syntax/usage.mdx +0 -130
  24. package/constellation/enforce-style-prop/usage.mdx +0 -47
  25. package/constellation/index/migration-guide.mdx +0 -309
  26. package/constellation/index/overview.mdx +0 -250
  27. package/constellation/index/props.mdx +0 -30
  28. package/constellation/local-cx-xcss/usage.mdx +0 -53
  29. package/constellation/no-array-arguments/usage.mdx +0 -49
  30. package/constellation/no-classname-prop/usage.mdx +0 -49
  31. package/constellation/no-container-queries/usage.mdx +0 -101
  32. package/constellation/no-css-tagged-template-expression/usage.mdx +0 -8
  33. package/constellation/no-dynamic-styles/usage.mdx +0 -130
  34. package/constellation/no-empty-styled-expression/usage.mdx +0 -8
  35. package/constellation/no-exported-css/usage.mdx +0 -8
  36. package/constellation/no-exported-keyframes/usage.mdx +0 -8
  37. package/constellation/no-exported-styles/usage.mdx +0 -87
  38. package/constellation/no-global-styles/usage.mdx +0 -60
  39. package/constellation/no-important-styles/usage.mdx +0 -33
  40. package/constellation/no-imported-style-values/usage.mdx +0 -157
  41. package/constellation/no-invalid-css-map/usage.mdx +0 -8
  42. package/constellation/no-js-xcss/usage.mdx +0 -7
  43. package/constellation/no-keyframes-tagged-template-expression/usage.mdx +0 -8
  44. package/constellation/no-nested-selectors/usage.mdx +0 -95
  45. package/constellation/no-styled/usage.mdx +0 -92
  46. package/constellation/no-styled-tagged-template-expression/usage.mdx +0 -8
  47. package/constellation/no-suppress-xcss/usage.mdx +0 -28
  48. package/constellation/no-unsafe-selectors/usage.mdx +0 -370
  49. package/constellation/no-unsafe-values/usage.mdx +0 -318
  50. package/constellation/use-compiled/usage.mdx +0 -54
  51. package/index.js +0 -24
  52. package/scripts/codegen.tsx +0 -373
  53. package/src/index.codegen.tsx +0 -14
  54. package/src/index.tsx +0 -1
  55. package/src/presets/all.codegen.tsx +0 -79
  56. package/src/presets/recommended.codegen.tsx +0 -79
  57. package/src/rules/TEMPLATE.md +0 -29
  58. package/src/rules/__tests__/utils/_tester.tsx +0 -40
  59. package/src/rules/atlaskit-theme/README.md +0 -130
  60. package/src/rules/atlaskit-theme/__tests__/test.ts +0 -133
  61. package/src/rules/atlaskit-theme/index.ts +0 -134
  62. package/src/rules/convert-props-syntax/README.md +0 -128
  63. package/src/rules/convert-props-syntax/__tests__/invalid.test.tsx +0 -76
  64. package/src/rules/convert-props-syntax/__tests__/rule.test.tsx +0 -584
  65. package/src/rules/convert-props-syntax/__tests__/type-annotations.test.tsx +0 -140
  66. package/src/rules/convert-props-syntax/__tests__/unusual-properties.test.tsx +0 -69
  67. package/src/rules/convert-props-syntax/index.tsx +0 -414
  68. package/src/rules/enforce-style-prop/README.md +0 -45
  69. package/src/rules/enforce-style-prop/__tests__/rule.test.tsx +0 -243
  70. package/src/rules/enforce-style-prop/index.tsx +0 -172
  71. package/src/rules/external-rules.tsx +0 -175
  72. package/src/rules/index.codegen.tsx +0 -42
  73. package/src/rules/local-cx-xcss/README.md +0 -51
  74. package/src/rules/local-cx-xcss/__tests__/rule.test.tsx +0 -102
  75. package/src/rules/local-cx-xcss/index.tsx +0 -62
  76. package/src/rules/no-array-arguments/README.md +0 -47
  77. package/src/rules/no-array-arguments/__tests__/rule.test.tsx +0 -107
  78. package/src/rules/no-array-arguments/index.tsx +0 -86
  79. package/src/rules/no-classname-prop/README.md +0 -47
  80. package/src/rules/no-classname-prop/__tests__/rule.test.tsx +0 -39
  81. package/src/rules/no-classname-prop/index.tsx +0 -34
  82. package/src/rules/no-container-queries/README.md +0 -99
  83. package/src/rules/no-container-queries/__tests__/rule.test.tsx +0 -139
  84. package/src/rules/no-container-queries/index.tsx +0 -94
  85. package/src/rules/no-dynamic-styles/README.md +0 -128
  86. package/src/rules/no-dynamic-styles/__tests__/rule.test.tsx +0 -135
  87. package/src/rules/no-dynamic-styles/index.tsx +0 -60
  88. package/src/rules/no-exported-styles/README.md +0 -85
  89. package/src/rules/no-exported-styles/__tests__/rule.test.tsx +0 -216
  90. package/src/rules/no-exported-styles/index.tsx +0 -52
  91. package/src/rules/no-global-styles/README.md +0 -58
  92. package/src/rules/no-global-styles/__tests__/no-css-modules.test.tsx +0 -33
  93. package/src/rules/no-global-styles/__tests__/no-global-styles.test.tsx +0 -46
  94. package/src/rules/no-global-styles/index.tsx +0 -82
  95. package/src/rules/no-important-styles/README.md +0 -31
  96. package/src/rules/no-important-styles/__tests__/rule.test.tsx +0 -165
  97. package/src/rules/no-important-styles/index.tsx +0 -70
  98. package/src/rules/no-imported-style-values/README.md +0 -155
  99. package/src/rules/no-imported-style-values/__tests__/rule.test.tsx +0 -491
  100. package/src/rules/no-imported-style-values/index.tsx +0 -188
  101. package/src/rules/no-nested-selectors/README.md +0 -93
  102. package/src/rules/no-nested-selectors/__tests__/rule.test.tsx +0 -335
  103. package/src/rules/no-nested-selectors/index.tsx +0 -99
  104. package/src/rules/no-styled/README.md +0 -90
  105. package/src/rules/no-styled/__tests__/rule.test.tsx +0 -73
  106. package/src/rules/no-styled/index.tsx +0 -45
  107. package/src/rules/no-unsafe-selectors/README.md +0 -368
  108. package/src/rules/no-unsafe-selectors/__tests__/no-ambiguous-pseudos.test.tsx +0 -368
  109. package/src/rules/no-unsafe-selectors/__tests__/no-grouped-at-rules.test.tsx +0 -57
  110. package/src/rules/no-unsafe-selectors/__tests__/no-increased-specificity.test.tsx +0 -73
  111. package/src/rules/no-unsafe-selectors/__tests__/no-keyframes-at-rules.test.tsx +0 -40
  112. package/src/rules/no-unsafe-selectors/__tests__/no-legacy-pseudo-element-syntax.test.tsx +0 -101
  113. package/src/rules/no-unsafe-selectors/__tests__/no-restricted-at-rules.test.tsx +0 -131
  114. package/src/rules/no-unsafe-selectors/__tests__/no-restricted-pseudos.test.tsx +0 -132
  115. package/src/rules/no-unsafe-selectors/__tests__/no-selectors-object.test.tsx +0 -25
  116. package/src/rules/no-unsafe-selectors/__tests__/no-unparsable-selectors.test.tsx +0 -35
  117. package/src/rules/no-unsafe-selectors/__tests__/rule.test.tsx +0 -257
  118. package/src/rules/no-unsafe-selectors/constants.tsx +0 -91
  119. package/src/rules/no-unsafe-selectors/index.tsx +0 -198
  120. package/src/rules/no-unsafe-selectors/lint-selector.tsx +0 -155
  121. package/src/rules/no-unsafe-selectors/source-position-utils.tsx +0 -55
  122. package/src/rules/no-unsafe-selectors/walk-css-map.tsx +0 -226
  123. package/src/rules/no-unsafe-values/README.md +0 -316
  124. package/src/rules/no-unsafe-values/__tests__/no-array-values.test.tsx +0 -27
  125. package/src/rules/no-unsafe-values/__tests__/no-conditional-values.test.tsx +0 -37
  126. package/src/rules/no-unsafe-values/__tests__/no-dynamic-keys.test.tsx +0 -229
  127. package/src/rules/no-unsafe-values/__tests__/no-function-calls.test.tsx +0 -267
  128. package/src/rules/no-unsafe-values/__tests__/no-identifier-arguments.test.tsx +0 -52
  129. package/src/rules/no-unsafe-values/__tests__/no-object-access.test.tsx +0 -106
  130. package/src/rules/no-unsafe-values/__tests__/no-object-references.test.tsx +0 -44
  131. package/src/rules/no-unsafe-values/__tests__/no-spread-elements.test.tsx +0 -48
  132. package/src/rules/no-unsafe-values/__tests__/no-unsafe-values.test.tsx +0 -75
  133. package/src/rules/no-unsafe-values/__tests__/no-variables.test.tsx +0 -121
  134. package/src/rules/no-unsafe-values/index.tsx +0 -94
  135. package/src/rules/no-unsafe-values/messages.tsx +0 -86
  136. package/src/rules/no-unsafe-values/utils.tsx +0 -387
  137. package/src/rules/use-compiled/README.md +0 -52
  138. package/src/rules/use-compiled/__tests__/can-auto-fix.test.tsx +0 -73
  139. package/src/rules/use-compiled/__tests__/css.test.tsx +0 -126
  140. package/src/rules/use-compiled/__tests__/imports.test.tsx +0 -158
  141. package/src/rules/use-compiled/__tests__/keyframes.test.tsx +0 -140
  142. package/src/rules/use-compiled/__tests__/pragma.test.tsx +0 -108
  143. package/src/rules/use-compiled/__tests__/styled.test.tsx +0 -114
  144. package/src/rules/use-compiled/__tests__/use-compiled.test.tsx +0 -15
  145. package/src/rules/use-compiled/index.tsx +0 -252
  146. package/src/rules/use-compiled/is-safe.tsx +0 -159
  147. package/src/rules/use-compiled/utils.tsx +0 -33
  148. package/src/rules/utils/create-rule-with-typed-config.tsx +0 -86
  149. package/src/rules/utils/create-rule.tsx +0 -13
  150. package/tsconfig.app.json +0 -47
  151. package/tsconfig.dev.json +0 -45
  152. package/tsconfig.json +0 -25
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/eslint-plugin-ui-styling-standard
2
2
 
3
+ ## 0.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#117847](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117847)
8
+ [`5795b7b47ceac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5795b7b47ceac) -
9
+ Removes redundant files from NPM deployment
10
+
11
+ ## 0.18.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#117005](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117005)
16
+ [`af9ff1e4ec472`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/af9ff1e4ec472) -
17
+ The recommended config now has `consistent-css-prop-usage` linting enabled for the `xcss` prop.
18
+
3
19
  ## 0.17.0
4
20
 
5
21
  ### Minor Changes
@@ -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::aa1d9d67dc9b6b0488df0b31ff142f30>>
9
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -30,7 +30,8 @@ var _default = exports.default = {
30
30
  '@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
31
31
  '@atlaskit/ui-styling-standard/use-compiled': 'error',
32
32
  '@atlaskit/design-system/consistent-css-prop-usage': ['error', {
33
- excludeReactComponents: true
33
+ excludeReactComponents: true,
34
+ shouldAlwaysCheckXcss: true
34
35
  }],
35
36
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
36
37
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': '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::aa1d9d67dc9b6b0488df0b31ff142f30>>
9
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -30,7 +30,8 @@ var _default = exports.default = {
30
30
  '@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
31
31
  '@atlaskit/ui-styling-standard/use-compiled': 'error',
32
32
  '@atlaskit/design-system/consistent-css-prop-usage': ['error', {
33
- excludeReactComponents: true
33
+ excludeReactComponents: true,
34
+ shouldAlwaysCheckXcss: true
34
35
  }],
35
36
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
36
37
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
@@ -23,7 +23,9 @@ var externalRules = exports.externalRules = [{
23
23
  // When passing a css prop to a React component, we don't know whether the component
24
24
  // is Emotion or Compiled. Hence it is not safe to run autofixes like wrapping it in
25
25
  // a `css` function call.
26
- excludeReactComponents: true
26
+ excludeReactComponents: true,
27
+ // Ensures that `xcss` prop is still linted even when `excludeReactComponents` is `true`.
28
+ shouldAlwaysCheckXcss: true
27
29
  }
28
30
  }
29
31
  }, {
@@ -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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  export default {
@@ -24,7 +24,8 @@ export default {
24
24
  '@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
25
25
  '@atlaskit/ui-styling-standard/use-compiled': 'error',
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': ['error', {
27
- excludeReactComponents: true
27
+ excludeReactComponents: true,
28
+ shouldAlwaysCheckXcss: true
28
29
  }],
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': '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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  export default {
@@ -24,7 +24,8 @@ export default {
24
24
  '@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
25
25
  '@atlaskit/ui-styling-standard/use-compiled': 'error',
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': ['error', {
27
- excludeReactComponents: true
27
+ excludeReactComponents: true,
28
+ shouldAlwaysCheckXcss: true
28
29
  }],
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
@@ -18,7 +18,9 @@ export const externalRules = [{
18
18
  // When passing a css prop to a React component, we don't know whether the component
19
19
  // is Emotion or Compiled. Hence it is not safe to run autofixes like wrapping it in
20
20
  // a `css` function call.
21
- excludeReactComponents: true
21
+ excludeReactComponents: true,
22
+ // Ensures that `xcss` prop is still linted even when `excludeReactComponents` is `true`.
23
+ shouldAlwaysCheckXcss: true
22
24
  }
23
25
  }
24
26
  }, {
@@ -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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  export default {
@@ -24,7 +24,8 @@ export default {
24
24
  '@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
25
25
  '@atlaskit/ui-styling-standard/use-compiled': 'error',
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': ['error', {
27
- excludeReactComponents: true
27
+ excludeReactComponents: true,
28
+ shouldAlwaysCheckXcss: true
28
29
  }],
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': '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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  export default {
@@ -24,7 +24,8 @@ export default {
24
24
  '@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
25
25
  '@atlaskit/ui-styling-standard/use-compiled': 'error',
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': ['error', {
27
- excludeReactComponents: true
27
+ excludeReactComponents: true,
28
+ shouldAlwaysCheckXcss: true
28
29
  }],
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
@@ -18,7 +18,9 @@ export var externalRules = [{
18
18
  // When passing a css prop to a React component, we don't know whether the component
19
19
  // is Emotion or Compiled. Hence it is not safe to run autofixes like wrapping it in
20
20
  // a `css` function call.
21
- excludeReactComponents: true
21
+ excludeReactComponents: true,
22
+ // Ensures that `xcss` prop is still linted even when `excludeReactComponents` is `true`.
23
+ shouldAlwaysCheckXcss: true
22
24
  }
23
25
  }
24
26
  }, {
@@ -22,6 +22,7 @@ export declare const configs: {
22
22
  '@atlaskit/ui-styling-standard/use-compiled': string;
23
23
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
24
24
  excludeReactComponents: boolean;
25
+ shouldAlwaysCheckXcss: boolean;
25
26
  })[];
26
27
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
27
28
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
@@ -64,6 +65,7 @@ export declare const configs: {
64
65
  '@atlaskit/ui-styling-standard/use-compiled': string;
65
66
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
66
67
  excludeReactComponents: boolean;
68
+ shouldAlwaysCheckXcss: boolean;
67
69
  })[];
68
70
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
69
71
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': 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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  declare const _default: {
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  '@atlaskit/ui-styling-standard/use-compiled': string;
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
27
27
  excludeReactComponents: boolean;
28
+ shouldAlwaysCheckXcss: boolean;
28
29
  })[];
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': 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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  declare const _default: {
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  '@atlaskit/ui-styling-standard/use-compiled': string;
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
27
27
  excludeReactComponents: boolean;
28
+ shouldAlwaysCheckXcss: boolean;
28
29
  })[];
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
@@ -22,6 +22,7 @@ export declare const configs: {
22
22
  '@atlaskit/ui-styling-standard/use-compiled': string;
23
23
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
24
24
  excludeReactComponents: boolean;
25
+ shouldAlwaysCheckXcss: boolean;
25
26
  })[];
26
27
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
27
28
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
@@ -64,6 +65,7 @@ export declare const configs: {
64
65
  '@atlaskit/ui-styling-standard/use-compiled': string;
65
66
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
66
67
  excludeReactComponents: boolean;
68
+ shouldAlwaysCheckXcss: boolean;
67
69
  })[];
68
70
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
69
71
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': 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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  declare const _default: {
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  '@atlaskit/ui-styling-standard/use-compiled': string;
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
27
27
  excludeReactComponents: boolean;
28
+ shouldAlwaysCheckXcss: boolean;
28
29
  })[];
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': 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::aa1d9d67dc9b6b0488df0b31ff142f30>>
3
+ * @codegen <<SignedSource::d6fe3ee209ccee89003da5d8fffba51e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
5
5
  */
6
6
  declare const _default: {
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  '@atlaskit/ui-styling-standard/use-compiled': string;
26
26
  '@atlaskit/design-system/consistent-css-prop-usage': (string | {
27
27
  excludeReactComponents: boolean;
28
+ shouldAlwaysCheckXcss: boolean;
28
29
  })[];
29
30
  '@atlaskit/design-system/no-css-tagged-template-expression': string;
30
31
  '@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-ui-styling-standard",
3
- "version": "0.17.0",
3
+ "version": "0.18.1",
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",
@@ -54,7 +54,7 @@
54
54
  "devDependencies": {
55
55
  "@af/formatting": "*",
56
56
  "@atlaskit/ds-lib": "^2.3.0",
57
- "@atlaskit/eslint-plugin-design-system": "^10.8.0",
57
+ "@atlaskit/eslint-plugin-design-system": "^10.10.0",
58
58
  "@atlassian/codegen": "*",
59
59
  "@compiled/eslint-plugin": "^0.13.6",
60
60
  "@types/eslint": "^8.56.6",
@@ -1,28 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.confluence.json",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "lib": [
6
- "ES2021.String"
7
- ],
8
- "composite": true,
9
- "outDir": "../dist",
10
- "rootDir": "../",
11
- "baseUrl": "../"
12
- },
13
- "include": [
14
- "../src/**/*.ts",
15
- "../src/**/*.tsx"
16
- ],
17
- "exclude": [
18
- "../src/**/__tests__/*",
19
- "../__tests__/*",
20
- "../src/**/*.test.*",
21
- "../src/**/test.*"
22
- ],
23
- "references": [
24
- {
25
- "path": "../../eslint-utils/afm-cc/tsconfig.json"
26
- }
27
- ]
28
- }
@@ -1,28 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.products.json",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "lib": [
6
- "ES2021.String"
7
- ],
8
- "outDir": "../../../../../tsDist/@atlaskit__eslint-plugin-ui-styling-standard/app",
9
- "composite": true,
10
- "rootDir": "../",
11
- "baseUrl": "../"
12
- },
13
- "include": [
14
- "../src/**/*.ts",
15
- "../src/**/*.tsx"
16
- ],
17
- "exclude": [
18
- "../src/**/__tests__/*",
19
- "../__tests__/*",
20
- "../src/**/*.test.*",
21
- "../src/**/test.*"
22
- ],
23
- "references": [
24
- {
25
- "path": "../../eslint-utils/afm-jira/tsconfig.json"
26
- }
27
- ]
28
- }
@@ -1,18 +0,0 @@
1
- {
2
- "extends": "../tsconfig",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "lib": ["ES2021.String"],
6
- "paths": {}
7
- },
8
- "include": [
9
- "../src/**/*.ts",
10
- "../src/**/*.tsx"
11
- ],
12
- "exclude": [
13
- "../src/**/__tests__/*",
14
- "../__tests__/*",
15
- "../src/**/*.test.*",
16
- "../src/**/test.*"
17
- ]
18
- }
@@ -1,132 +0,0 @@
1
- # atlaskit-theme
2
-
3
- Blocks legacy `@atlaskit/theme` mixins that `@compiled/react` cannot compile. This includes the
4
- `typography`, `elevation` and `skeletonShimmer` mixins.
5
-
6
- ## Examples
7
-
8
- ### Typography
9
-
10
- Don't use `typography` mixins.
11
-
12
- Use [typography tokens](https://atlassian.design/foundations/typography-beta/applying-typography) or
13
- the [Heading](https://atlassian.design/components/heading) and
14
- [Text](https://atlassian.design/components/primitives/text) components.
15
-
16
- #### Incorrect
17
-
18
- ```tsx
19
- import { css } from '@compiled/react';
20
- import { typography } from '@atlaskit/theme';
21
-
22
- const titleStyles = css(typography.h700());
23
- ```
24
-
25
- #### Correct
26
-
27
- ```tsx
28
- import { css } from '@compiled/react';
29
- import { token } from '@atlaskit/tokens';
30
-
31
- const titleStyles = css({
32
- font: token('font.heading.large'),
33
- });
34
-
35
- const paragraphStyles = css({
36
- font: token('font.body.large'),
37
- });
38
- ```
39
-
40
- ```tsx
41
- import { css } from '@compiled/react';
42
- import Heading from '@atlaskit/heading';
43
- import { Stack, Text } from '@atlaskit/primitives';
44
- import { token } from '@atlaskit/tokens';
45
-
46
- const Component = () => (
47
- <Stack>
48
- <Heading size="large">Title</Heading>
49
- <Text size="large">Lorem ipsum</Text>
50
- </Stack>
51
- );
52
- ```
53
-
54
- ### Elevation
55
-
56
- Don't use `elevation` mixins.
57
-
58
- Use [elevation tokens](https://atlassian.design/foundations/elevation) instead.
59
-
60
- #### Incorrect
61
-
62
- ```tsx
63
- import { css } from '@compiled/react';
64
- import { elevation } from '@atlaskit/theme';
65
-
66
- const cardStyles = css(elevation.e100());
67
- ```
68
-
69
- #### Correct
70
-
71
- ```tsx
72
- import { styled } from '@compiled/react';
73
- import { token } from '@atlaskit/tokens';
74
-
75
- const cardStyles = css({
76
- backgroundColor: token('elevation.surface.raised'),
77
- boxShadow: token('elevation.shadow.raised'),
78
- });
79
- ```
80
-
81
- ### Skeleton Shimmer
82
-
83
- Don't use the `skeletonShimmer` mixin.
84
-
85
- Preview our [Skeleton](https://staging.atlassian.design/components/skeleton/examples) component
86
- (internal Atlassians only).
87
-
88
- Otherwise:
89
-
90
- - Use the `color.skeleton` and `color.skeleton.subtle` tokens to make your own component.
91
- - Use `@atlassian/jira-skeletons` when working on Jira (internal Atlassians only).
92
-
93
- #### Incorrect
94
-
95
- ```tsx
96
- import { css } from '@compiled/react';
97
- import { skeletonShimmer } from '@atlaskit/theme/constants';
98
-
99
- const skeletonStyles = css(skeletonShimmer());
100
- ```
101
-
102
- #### Correct
103
-
104
- ```tsx
105
- import Skeleton from '@atlaskit/skeleton';
106
-
107
- <Skeleton width="200px" height="16px" isShimmering />;
108
- ```
109
-
110
- ```tsx
111
- import { css, keyframes } from '@compiled/react';
112
-
113
- const shimmer = keyframes({
114
- from: { backgroundColor: token('color.skeleton') },
115
- to: { backgroundColor: token('color.skeleton.subtle') },
116
- });
117
-
118
- const skeletonStyles = css({
119
- backgroundColor: token('color.skeleton'),
120
- animationName: shimmer,
121
- animationDuration: '1.5s',
122
- animationIterationCount: 'infinite',
123
- animationTimingFunction: 'linear',
124
- animationDirection: 'alternate',
125
- });
126
- ```
127
-
128
- ```tsx
129
- import { ListSkeleton } from '@atlassian/jira-skeletons';
130
-
131
- <ListSkeleton numOfRows={3} />;
132
- ```
@@ -1,7 +0,0 @@
1
- # @atlaskit/design-system/consistent-css-prop-usage
2
-
3
- Ensures consistency with all `css` and `xcss` prop usages.
4
-
5
- This rule is maintained by another package and configured here; refer to
6
- https://atlassian.design/components/eslint-plugin-design-system/consistent-css-prop-usage/usage for
7
- more details.
@@ -1,130 +0,0 @@
1
- # convert-props-syntax
2
-
3
- Blocks dynamic styling syntax that is unsupported by `styled-components@<4` and `@emotion/styled`,
4
- and provides an autofix for converting to a supported syntax.
5
-
6
- Use this rule alongside `no-styled-tagged-template-expression`, which can output the unsupported
7
- dynamic styling syntax.
8
-
9
- This rule applies only to `styled` usages from `styled-components` and `@emotion/styled`.
10
-
11
- ## Autofix
12
-
13
- The autofix will find style object values that are arrow functions,
14
-
15
- ```tsx
16
- styled.div({
17
- color: ({ myColor }) => myColor,
18
- backgroundColor: (props) => props.someColor,
19
- });
20
- ```
21
-
22
- However, refactoring the arrow function so that it is the argument to `styled.div` will fix the
23
- issue:
24
-
25
- ```tsx
26
- styled.div((props) => ({
27
- color: props.myColor,
28
- backgroundColor: props.someColor,
29
- }));
30
- ```
31
-
32
- This ESLint rule will only run on usages of the `styled` API when imported from libraries that are
33
- known to have this problem.
34
-
35
- ## About the autofixer
36
-
37
- This rule has an autofixer that will automatically perform the above arrow function refactoring for
38
- the majority of cases, including for nested selectors and any props used in template literal values.
39
-
40
- However, there are a few situations where the autofixer will not be run. For these, you will need to
41
- manually fix the output, or migrate the code to `@compiled/react`.
42
-
43
- ### Type annotations
44
-
45
- Type annotations in the arrow function are not supported; you will need to remediate the lint error
46
- manually. For example:
47
-
48
- ```tsx
49
- type Props = {
50
- myColor: string;
51
- someColor: string;
52
- };
53
-
54
- styled.div({
55
- color: ({ myColor }: Props) => myColor,
56
- backgroundColor: (props: Props) => props.someColor,
57
- });
58
- ```
59
-
60
- could be refactored as
61
-
62
- ```tsx
63
- type Props = {
64
- myColor: string;
65
- someColor: string;
66
- };
67
-
68
- styled.div((props: Props) => ({
69
- color: props.myColor,
70
- backgroundColor: props.someColor,
71
- }));
72
- ```
73
-
74
- ### Special syntax in function parameters
75
-
76
- Rest elements, default values, and so on in the parameter of an arrow function will need to be
77
- remediated manually. For example:
78
-
79
- ```tsx
80
- styled.div({
81
- color: ({ myColor = '#fff' }) => myColor,
82
- backgroundColor: ({ myColor = '#aaa' }) => myColor,
83
- });
84
- ```
85
-
86
- could be refactored as
87
-
88
- ```tsx
89
- styled.div((props) => ({
90
- color: myColor ?? '#fff',
91
- backgroundColor: myColor ?? '#aaa',
92
- }));
93
- ```
94
-
95
- ## Examples
96
-
97
- ### Incorrect
98
-
99
- ```tsx
100
- import styled from 'styled-components';
101
-
102
- styled.div({
103
- color: ({ myColor }) => myColor,
104
- backgroundColor: (props) => props.someColor,
105
- });
106
-
107
- styled.div({
108
- color: `url(/tmp/${({ coolProp }) => coolProp}.png)`,
109
- });
110
- ```
111
-
112
- ### Correct
113
-
114
- ```tsx
115
- import styled from '@emotion/styled';
116
-
117
- styled.div((props) => ({
118
- color: props.myColor,
119
- backgroundColor: props.someColor,
120
- }));
121
-
122
- styled.div((props) => ({
123
- color: url(`/tmp/${coolProp}.png`),
124
- }));
125
- ```
126
-
127
- ## When not to use it
128
-
129
- You do not need this rule if you are not using a codebase that has a violating library as it will
130
- never do anything.