@atlaskit/eslint-plugin-design-system 10.4.4 → 10.4.5

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,14 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 10.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#107585](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107585)
8
+ [`c7428760443b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c7428760443b) -
9
+ Fixes bugs with `no-html-button` and `no-html-anchor` rules that was falsely reporting for styled
10
+ components not used in the same file they are defined in.
11
+
3
12
  ## 10.4.4
4
13
 
5
14
  ### Patch Changes
@@ -23,6 +23,10 @@ var StyledComponent = exports.StyledComponent = {
23
23
  return;
24
24
  }
25
25
  var jsxElement = (_getJsxElementByName = (0, _getJsxElementByName2.getJsxElementByName)(styles.id.name, context.getScope())) === null || _getJsxElementByName === void 0 ? void 0 : _getJsxElementByName.parent;
26
+ if (!jsxElement) {
27
+ // If there's no JSX element, we can't determine if it's being used as an anchor or not
28
+ return;
29
+ }
26
30
  if (jsxElement && !(0, _supported.isSupportedForLint)(jsxElement, elementName)) {
27
31
  return;
28
32
  }
@@ -23,6 +23,10 @@ var StyledComponent = exports.StyledComponent = {
23
23
  return;
24
24
  }
25
25
  var jsxElement = (_getJsxElementByName = (0, _getJsxElementByName2.getJsxElementByName)(styles.id.name, context.getScope())) === null || _getJsxElementByName === void 0 ? void 0 : _getJsxElementByName.parent;
26
+ if (!jsxElement) {
27
+ // If there's no JSX element, we can't determine if it's being used as a button or not
28
+ return;
29
+ }
26
30
  if (jsxElement && !(0, _supported.isSupportedForLint)(jsxElement, elementName)) {
27
31
  return;
28
32
  }
@@ -18,6 +18,10 @@ export const StyledComponent = {
18
18
  return;
19
19
  }
20
20
  const jsxElement = (_getJsxElementByName = getJsxElementByName(styles.id.name, context.getScope())) === null || _getJsxElementByName === void 0 ? void 0 : _getJsxElementByName.parent;
21
+ if (!jsxElement) {
22
+ // If there's no JSX element, we can't determine if it's being used as an anchor or not
23
+ return;
24
+ }
21
25
  if (jsxElement && !isSupportedForLint(jsxElement, elementName)) {
22
26
  return;
23
27
  }
@@ -18,6 +18,10 @@ export const StyledComponent = {
18
18
  return;
19
19
  }
20
20
  const jsxElement = (_getJsxElementByName = getJsxElementByName(styles.id.name, context.getScope())) === null || _getJsxElementByName === void 0 ? void 0 : _getJsxElementByName.parent;
21
+ if (!jsxElement) {
22
+ // If there's no JSX element, we can't determine if it's being used as a button or not
23
+ return;
24
+ }
21
25
  if (jsxElement && !isSupportedForLint(jsxElement, elementName)) {
22
26
  return;
23
27
  }
@@ -17,6 +17,10 @@ export var StyledComponent = {
17
17
  return;
18
18
  }
19
19
  var jsxElement = (_getJsxElementByName = getJsxElementByName(styles.id.name, context.getScope())) === null || _getJsxElementByName === void 0 ? void 0 : _getJsxElementByName.parent;
20
+ if (!jsxElement) {
21
+ // If there's no JSX element, we can't determine if it's being used as an anchor or not
22
+ return;
23
+ }
20
24
  if (jsxElement && !isSupportedForLint(jsxElement, elementName)) {
21
25
  return;
22
26
  }
@@ -17,6 +17,10 @@ export var StyledComponent = {
17
17
  return;
18
18
  }
19
19
  var jsxElement = (_getJsxElementByName = getJsxElementByName(styles.id.name, context.getScope())) === null || _getJsxElementByName === void 0 ? void 0 : _getJsxElementByName.parent;
20
+ if (!jsxElement) {
21
+ // If there's no JSX element, we can't determine if it's being used as a button or not
22
+ return;
23
+ }
20
24
  if (jsxElement && !isSupportedForLint(jsxElement, elementName)) {
21
25
  return;
22
26
  }
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": "10.4.4",
4
+ "version": "10.4.5",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {