@atlaskit/eslint-plugin-design-system 13.19.0 → 13.19.2

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,24 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 13.19.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#192592](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192592)
8
+ [`558893bdbc7c3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/558893bdbc7c3) -
9
+ Fixed no-legacy-icons auto fixer to retain size prop when migrating from migration to final core
10
+ entry point
11
+ - Updated dependencies
12
+
13
+ ## 13.19.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [#188952](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/188952)
18
+ [`1a88e6e2601ae`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a88e6e2601ae) -
19
+ Migrated usage of renamed/deprecated icons
20
+ - Updated dependencies
21
+
3
22
  ## 13.19.0
4
23
 
5
24
  ### Minor Changes
@@ -40,7 +40,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
40
40
  recommended: false
41
41
  },
42
42
  messages: {
43
- 'no-emotion-primitives': 'Use @atlaskit/primitives/compiled instead of @atlaskit/primitives'
43
+ 'no-emotion-primitives': 'Use @atlaskit/primitives/compiled instead of @atlaskit/primitives. Refer to go/akcss for more information.'
44
44
  },
45
45
  schema: schema
46
46
  },
@@ -536,7 +536,8 @@ var createPropFixes = function createPropFixes(_ref7) {
536
536
  newIconName = _ref7.newIconName;
537
537
  var fixes = [];
538
538
  var spacing = metadata.spacing,
539
- size = metadata.size;
539
+ size = metadata.size,
540
+ importSource = metadata.importSource;
540
541
  if (shouldUseMigrationPath && !legacyImportNode) {
541
542
  return fixes;
542
543
  }
@@ -565,8 +566,11 @@ var createPropFixes = function createPropFixes(_ref7) {
565
566
  if (size && sizeProp.value) {
566
567
  // update size prop with new replacement size
567
568
  fixes.push(fixer.replaceText(sizeProp.value, "\"".concat(size, "\"")));
568
- } else {
569
- // remove size prop if no new replacement size is specified
569
+ } else if (importSource.startsWith('@atlaskit/icon/glyph/')) {
570
+ // only remove size prop for glyph entry points if no new replacement size is specified
571
+ fixes.push(fixer.remove(sizeProp));
572
+ } else if (sizeProp.value && sizeProp.value.type === 'Literal' && typeof sizeProp.value.value === 'string' && sizeProp.value.value === 'medium') {
573
+ // if size is medium, we can remove it as it is the default size
570
574
  fixes.push(fixer.remove(sizeProp));
571
575
  }
572
576
  }
@@ -11,7 +11,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
11
11
  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; } }
12
12
  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; }
13
13
  var specialCases = {
14
- '@atlaskit/icon/utility/migration/cross--editor-close': '@atlaskit/icon/core/migration/close--editor-close'
14
+ '@atlaskit/icon/utility/migration/cross--editor-close': '@atlaskit/icon/core/migration/cross--editor-close'
15
15
  };
16
16
  var iconPropsinNewButton = ['icon', 'iconBefore', 'iconAfter'];
17
17
  var createChecks = exports.createChecks = function createChecks(context) {
@@ -30,7 +30,7 @@ export const rule = createLintRule({
30
30
  recommended: false
31
31
  },
32
32
  messages: {
33
- 'no-emotion-primitives': 'Use @atlaskit/primitives/compiled instead of @atlaskit/primitives'
33
+ 'no-emotion-primitives': 'Use @atlaskit/primitives/compiled instead of @atlaskit/primitives. Refer to go/akcss for more information.'
34
34
  },
35
35
  schema
36
36
  },
@@ -517,7 +517,8 @@ const createPropFixes = ({
517
517
  const fixes = [];
518
518
  const {
519
519
  spacing,
520
- size
520
+ size,
521
+ importSource
521
522
  } = metadata;
522
523
  if (shouldUseMigrationPath && !legacyImportNode) {
523
524
  return fixes;
@@ -551,8 +552,11 @@ const createPropFixes = ({
551
552
  if (size && sizeProp.value) {
552
553
  // update size prop with new replacement size
553
554
  fixes.push(fixer.replaceText(sizeProp.value, `"${size}"`));
554
- } else {
555
- // remove size prop if no new replacement size is specified
555
+ } else if (importSource.startsWith('@atlaskit/icon/glyph/')) {
556
+ // only remove size prop for glyph entry points if no new replacement size is specified
557
+ fixes.push(fixer.remove(sizeProp));
558
+ } else if (sizeProp.value && sizeProp.value.type === 'Literal' && typeof sizeProp.value.value === 'string' && sizeProp.value.value === 'medium') {
559
+ // if size is medium, we can remove it as it is the default size
556
560
  fixes.push(fixer.remove(sizeProp));
557
561
  }
558
562
  }
@@ -1,6 +1,6 @@
1
1
  import { isNodeOfType } from 'eslint-codemod-utils';
2
2
  const specialCases = {
3
- '@atlaskit/icon/utility/migration/cross--editor-close': '@atlaskit/icon/core/migration/close--editor-close'
3
+ '@atlaskit/icon/utility/migration/cross--editor-close': '@atlaskit/icon/core/migration/cross--editor-close'
4
4
  };
5
5
  const iconPropsinNewButton = ['icon', 'iconBefore', 'iconAfter'];
6
6
  export const createChecks = context => {
@@ -33,7 +33,7 @@ export var rule = createLintRule({
33
33
  recommended: false
34
34
  },
35
35
  messages: {
36
- 'no-emotion-primitives': 'Use @atlaskit/primitives/compiled instead of @atlaskit/primitives'
36
+ 'no-emotion-primitives': 'Use @atlaskit/primitives/compiled instead of @atlaskit/primitives. Refer to go/akcss for more information.'
37
37
  },
38
38
  schema: schema
39
39
  },
@@ -527,7 +527,8 @@ var createPropFixes = function createPropFixes(_ref7) {
527
527
  newIconName = _ref7.newIconName;
528
528
  var fixes = [];
529
529
  var spacing = metadata.spacing,
530
- size = metadata.size;
530
+ size = metadata.size,
531
+ importSource = metadata.importSource;
531
532
  if (shouldUseMigrationPath && !legacyImportNode) {
532
533
  return fixes;
533
534
  }
@@ -556,8 +557,11 @@ var createPropFixes = function createPropFixes(_ref7) {
556
557
  if (size && sizeProp.value) {
557
558
  // update size prop with new replacement size
558
559
  fixes.push(fixer.replaceText(sizeProp.value, "\"".concat(size, "\"")));
559
- } else {
560
- // remove size prop if no new replacement size is specified
560
+ } else if (importSource.startsWith('@atlaskit/icon/glyph/')) {
561
+ // only remove size prop for glyph entry points if no new replacement size is specified
562
+ fixes.push(fixer.remove(sizeProp));
563
+ } else if (sizeProp.value && sizeProp.value.type === 'Literal' && typeof sizeProp.value.value === 'string' && sizeProp.value.value === 'medium') {
564
+ // if size is medium, we can remove it as it is the default size
561
565
  fixes.push(fixer.remove(sizeProp));
562
566
  }
563
567
  }
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
4
4
  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; }
5
5
  import { isNodeOfType } from 'eslint-codemod-utils';
6
6
  var specialCases = {
7
- '@atlaskit/icon/utility/migration/cross--editor-close': '@atlaskit/icon/core/migration/close--editor-close'
7
+ '@atlaskit/icon/utility/migration/cross--editor-close': '@atlaskit/icon/core/migration/cross--editor-close'
8
8
  };
9
9
  var iconPropsinNewButton = ['icon', 'iconBefore', 'iconAfter'];
10
10
  export var createChecks = function createChecks(context) {
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.19.0",
4
+ "version": "13.19.2",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@atlaskit/eslint-utils": "^2.0.0",
46
- "@atlaskit/icon": "^27.5.0",
46
+ "@atlaskit/icon": "^27.8.0",
47
47
  "@atlaskit/icon-lab": "^5.2.0",
48
48
  "@atlaskit/tokens": "^5.6.0",
49
49
  "@babel/runtime": "^7.0.0",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@af/formatting": "workspace:^",
61
- "@atlaskit/ds-lib": "^4.1.0",
61
+ "@atlaskit/ds-lib": "^5.0.0",
62
62
  "@atlaskit/theme": "^19.0.0",
63
63
  "@atlassian/codegen": "^0.1.0",
64
64
  "@atlassian/eslint-utils": "^0.5.0",