@atlaskit/eslint-plugin-design-system 8.25.0 → 8.25.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
+ ## 8.25.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#67941](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67941) [`0b1def807516`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0b1def807516) - Now rule is aplicable only to ButtonGroup ImportSpecifiers
8
+
3
9
  ## 8.25.0
4
10
 
5
11
  ### Minor Changes
@@ -30,16 +30,18 @@ var rule = (0, _createRule.createLintRule)({
30
30
  var contextLocalIdentifier = [];
31
31
  return {
32
32
  ImportDeclaration: function ImportDeclaration(node) {
33
- if (node.source.value === '@atlaskit/button') {
34
- if (node.specifiers.length) {
35
- var defaultImport = node.specifiers.filter(function (spec) {
36
- return spec.type === 'ImportSpecifier';
37
- });
38
- if (defaultImport && defaultImport.length) {
39
- var local = defaultImport[0].local;
40
- contextLocalIdentifier.push(local.name);
41
- }
33
+ var _node$specifiers;
34
+ var buttonGroupIdentifier = (_node$specifiers = node.specifiers) === null || _node$specifiers === void 0 ? void 0 : _node$specifiers.filter(function (spec) {
35
+ if (node.source.value === '@atlaskit/button') {
36
+ var _spec$imported;
37
+ return spec.type === 'ImportSpecifier' && ((_spec$imported = spec.imported) === null || _spec$imported === void 0 ? void 0 : _spec$imported.name) === 'ButtonGroup';
38
+ } else if (node.source.value === '@atlaskit/button/button-group') {
39
+ return spec.type === 'ImportDefaultSpecifier';
42
40
  }
41
+ });
42
+ if (buttonGroupIdentifier !== null && buttonGroupIdentifier !== void 0 && buttonGroupIdentifier.length) {
43
+ var local = buttonGroupIdentifier[0].local;
44
+ contextLocalIdentifier.push(local.name);
43
45
  }
44
46
  },
45
47
  JSXElement: function JSXElement(node) {
@@ -24,16 +24,20 @@ const rule = createLintRule({
24
24
  const contextLocalIdentifier = [];
25
25
  return {
26
26
  ImportDeclaration(node) {
27
- if (node.source.value === '@atlaskit/button') {
28
- if (node.specifiers.length) {
29
- const defaultImport = node.specifiers.filter(spec => spec.type === 'ImportSpecifier');
30
- if (defaultImport && defaultImport.length) {
31
- const {
32
- local
33
- } = defaultImport[0];
34
- contextLocalIdentifier.push(local.name);
35
- }
27
+ var _node$specifiers;
28
+ const buttonGroupIdentifier = (_node$specifiers = node.specifiers) === null || _node$specifiers === void 0 ? void 0 : _node$specifiers.filter(spec => {
29
+ if (node.source.value === '@atlaskit/button') {
30
+ var _spec$imported;
31
+ return spec.type === 'ImportSpecifier' && ((_spec$imported = spec.imported) === null || _spec$imported === void 0 ? void 0 : _spec$imported.name) === 'ButtonGroup';
32
+ } else if (node.source.value === '@atlaskit/button/button-group') {
33
+ return spec.type === 'ImportDefaultSpecifier';
36
34
  }
35
+ });
36
+ if (buttonGroupIdentifier !== null && buttonGroupIdentifier !== void 0 && buttonGroupIdentifier.length) {
37
+ const {
38
+ local
39
+ } = buttonGroupIdentifier[0];
40
+ contextLocalIdentifier.push(local.name);
37
41
  }
38
42
  },
39
43
  JSXElement(node) {
@@ -24,16 +24,18 @@ var rule = createLintRule({
24
24
  var contextLocalIdentifier = [];
25
25
  return {
26
26
  ImportDeclaration: function ImportDeclaration(node) {
27
- if (node.source.value === '@atlaskit/button') {
28
- if (node.specifiers.length) {
29
- var defaultImport = node.specifiers.filter(function (spec) {
30
- return spec.type === 'ImportSpecifier';
31
- });
32
- if (defaultImport && defaultImport.length) {
33
- var local = defaultImport[0].local;
34
- contextLocalIdentifier.push(local.name);
35
- }
27
+ var _node$specifiers;
28
+ var buttonGroupIdentifier = (_node$specifiers = node.specifiers) === null || _node$specifiers === void 0 ? void 0 : _node$specifiers.filter(function (spec) {
29
+ if (node.source.value === '@atlaskit/button') {
30
+ var _spec$imported;
31
+ return spec.type === 'ImportSpecifier' && ((_spec$imported = spec.imported) === null || _spec$imported === void 0 ? void 0 : _spec$imported.name) === 'ButtonGroup';
32
+ } else if (node.source.value === '@atlaskit/button/button-group') {
33
+ return spec.type === 'ImportDefaultSpecifier';
36
34
  }
35
+ });
36
+ if (buttonGroupIdentifier !== null && buttonGroupIdentifier !== void 0 && buttonGroupIdentifier.length) {
37
+ var local = buttonGroupIdentifier[0].local;
38
+ contextLocalIdentifier.push(local.name);
37
39
  }
38
40
  },
39
41
  JSXElement: function JSXElement(node) {
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": "8.25.0",
4
+ "version": "8.25.1",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"