@atlaskit/eslint-plugin-design-system 13.18.0 → 13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 13.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#188850](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/188850)
8
+ [`8b19a85abe51e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8b19a85abe51e) -
9
+ Add nmore cases to the new use correct field rule.
10
+ - Updated dependencies
11
+
3
12
  ## 13.18.0
4
13
 
5
14
  ### Minor Changes
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useRangeFieldMessage = exports.useCheckboxFieldMessage = exports.default = void 0;
7
7
  var _eslintCodemodUtils = require("eslint-codemod-utils");
8
8
  var _createRule = require("../utils/create-rule");
9
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
10
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
9
12
  var specialFieldsByImport = {
10
13
  '@atlaskit/checkbox': {
11
14
  component: 'Checkbox',
@@ -109,6 +112,22 @@ var rule = (0, _createRule.createLintRule)({
109
112
  var found;
110
113
  while (q.length > 0 && !found) {
111
114
  var child = q.pop();
115
+ if ('children' in child) {
116
+ var _iterator = _createForOfIteratorHelper(child.children),
117
+ _step;
118
+ try {
119
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
120
+ var innerChild = _step.value;
121
+ q.push(innerChild);
122
+ }
123
+ } catch (err) {
124
+ _iterator.e(err);
125
+ } finally {
126
+ _iterator.f();
127
+ }
128
+ } else if ((0, _eslintCodemodUtils.isNodeOfType)(child, 'BlockStatement') && (0, _eslintCodemodUtils.isNodeOfType)(child.body[0], 'ExpressionStatement')) {
129
+ q.push(child.body[0].expression);
130
+ }
112
131
  if (!(0, _eslintCodemodUtils.isNodeOfType)(child, 'JSXElement') || !(0, _eslintCodemodUtils.isNodeOfType)(child.openingElement.name, 'JSXIdentifier')) {
113
132
  continue;
114
133
  }
@@ -95,6 +95,13 @@ const rule = createLintRule({
95
95
  let found;
96
96
  while (q.length > 0 && !found) {
97
97
  const child = q.pop();
98
+ if ('children' in child) {
99
+ for (const innerChild of child.children) {
100
+ q.push(innerChild);
101
+ }
102
+ } else if (isNodeOfType(child, 'BlockStatement') && isNodeOfType(child.body[0], 'ExpressionStatement')) {
103
+ q.push(child.body[0].expression);
104
+ }
98
105
  if (!isNodeOfType(child, 'JSXElement') || !isNodeOfType(child.openingElement.name, 'JSXIdentifier')) {
99
106
  continue;
100
107
  }
@@ -1,3 +1,6 @@
1
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
2
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1
4
  import { isNodeOfType } from 'eslint-codemod-utils';
2
5
  import { createLintRule } from '../utils/create-rule';
3
6
  var specialFieldsByImport = {
@@ -103,6 +106,22 @@ var rule = createLintRule({
103
106
  var found;
104
107
  while (q.length > 0 && !found) {
105
108
  var child = q.pop();
109
+ if ('children' in child) {
110
+ var _iterator = _createForOfIteratorHelper(child.children),
111
+ _step;
112
+ try {
113
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
114
+ var innerChild = _step.value;
115
+ q.push(innerChild);
116
+ }
117
+ } catch (err) {
118
+ _iterator.e(err);
119
+ } finally {
120
+ _iterator.f();
121
+ }
122
+ } else if (isNodeOfType(child, 'BlockStatement') && isNodeOfType(child.body[0], 'ExpressionStatement')) {
123
+ q.push(child.body[0].expression);
124
+ }
106
125
  if (!isNodeOfType(child, 'JSXElement') || !isNodeOfType(child.openingElement.name, 'JSXIdentifier')) {
107
126
  continue;
108
127
  }
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": "13.18.0",
4
+ "version": "13.18.1",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -43,9 +43,9 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@atlaskit/eslint-utils": "^2.0.0",
46
- "@atlaskit/icon": "^27.3.0",
46
+ "@atlaskit/icon": "^27.5.0",
47
47
  "@atlaskit/icon-lab": "^5.2.0",
48
- "@atlaskit/tokens": "^5.5.0",
48
+ "@atlaskit/tokens": "^5.6.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@typescript-eslint/utils": "^7.1.0",
51
51
  "ajv": "^6.12.6",