@atlaskit/eslint-plugin-design-system 9.2.0 → 9.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 9.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#85899](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/85899) [`4ee3baaad3b7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4ee3baaad3b7) - Loosen our final autofix check to just ignore all interpolated keys or properties in general for all `no-*-tagged-template-expression` rules as they may result in broken code in some edge-cases.
8
+
3
9
  ## 9.2.0
4
10
 
5
11
  ### Minor Changes
@@ -104,7 +104,7 @@ var createNoTaggedTemplateExpressionRule = exports.createNoTaggedTemplateExpress
104
104
  }
105
105
  return _context.abrupt("return");
106
106
  case 19:
107
- if (!/\$\{.*:[\s]*\{/.test(newCode)) {
107
+ if (!/\$\{.*:/.test(newCode)) {
108
108
  _context.next = 21;
109
109
  break;
110
110
  }
@@ -83,15 +83,14 @@ export const createNoTaggedTemplateExpressionRule = (isUsage, messageId) => cont
83
83
  if (usesEmotion && !!newCode.match(/!\s*important/gm)) {
84
84
  return;
85
85
  }
86
-
87
- // For styled-components, we might also want to similarly disallow or autofix `styled.div({ color: props => props.color })` as it's broken too (both type and functionality). This is tracked in https://product-fabric.atlassian.net/browse/USS-26.
88
- if (/\$\{.*:[\s]*\{/.test(newCode)) {
86
+ if (/\$\{.*:/.test(newCode)) {
89
87
  /**
90
- * If we find a variable in a selector, we skip it. There are two reasons:
91
- *
88
+ * If we find a variable in a property at all, we skip it. There are two reasons:
92
89
  * - `styled-components@3.x` does not support variables in a selector (see the first example).
90
+ * - We cannot guarantee that the contents of a mixin will ever be valid as a property or selector (which in tagged template expressions don't have to even be called).
91
+ * - It's not uncommon we just get this parsing wrong altogether…
93
92
  *
94
- * - We cannot guarantee that the contents of an function call is actually a selector, and not a CSS block (see the third example).
93
+ * // TODO: In this case, we _might_ want to convert this into a suggestion to support manual remediation, some of those code isn't bad, or it can be manually made safe…
95
94
  *
96
95
  * @examples
97
96
  * ```tsx
@@ -103,6 +102,7 @@ export const createNoTaggedTemplateExpressionRule = (isUsage, messageId) => cont
103
102
  * ```tsx
104
103
  * const Component = styled.div`
105
104
  * ${mixin()} button { color: red; }
105
+ * ${mixin} button { color: red; }
106
106
  * `;
107
107
  * ```
108
108
  *
@@ -97,7 +97,7 @@ export var createNoTaggedTemplateExpressionRule = function createNoTaggedTemplat
97
97
  }
98
98
  return _context.abrupt("return");
99
99
  case 19:
100
- if (!/\$\{.*:[\s]*\{/.test(newCode)) {
100
+ if (!/\$\{.*:/.test(newCode)) {
101
101
  _context.next = 21;
102
102
  break;
103
103
  }
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": "9.2.0",
4
+ "version": "9.2.1",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {