@atlaskit/eslint-plugin-design-system 13.35.1 → 13.36.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,22 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 13.36.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3c3757717bc78`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3c3757717bc78) -
8
+ Introduced a temporary feature to the `no-unsafe-design-token-usage` rule to allow token fallbacks
9
+ for tokens specified in `UNSAFE_ignoreTokens` even if `fallbackUsage` is set to 'none'. This
10
+ should not be used and exists only to aid migration. It will be removed in the near future.
11
+
12
+ ## 13.36.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`3147ae92ea7bd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3147ae92ea7bd) -
17
+ Updates lozenge-badge-tag-labelling-system-migration eslint rule to include the migration_fallback
18
+ prop so that teams can adopt the Tag API without triggering an immediate visual change.
19
+
3
20
  ## 13.35.1
4
21
 
5
22
  ### Patch Changes
@@ -22,7 +22,7 @@ var rule = (0, _createRule.createLintRule)({
22
22
  },
23
23
  messages: {
24
24
  updateAppearance: 'Update appearance value to new semantic value.',
25
- migrateTag: 'Non-bold <Lozenge> variants should migrate to <Tag> component.',
25
+ migrateTag: 'Non-bold <Lozenge> variants should migrate to <Tag> component. For safe, staged rollout, use the `migration_fallback="lozenge"` prop which renders as Lozenge when the feature flag is off.',
26
26
  manualReview: "Dynamic 'isBold' props require manual review before migration.",
27
27
  dynamicLozengeAppearance: "Dynamic 'appearance' prop values require manual review before migrating to Tag. Please verify the appearance value and manually convert it to the appropriate color prop value.",
28
28
  updateBadgeAppearance: 'Update Badge appearance value "{{oldValue}}" to new semantic value "{{newValue}}".',
@@ -365,6 +365,11 @@ var rule = (0, _createRule.createLintRule)({
365
365
  if (options.isSimpleTag || options.isLozengeMigration) {
366
366
  newAttributes.push('isRemovable={false}');
367
367
  }
368
+
369
+ // Add migration_fallback="lozenge" for Lozenge migrations to enable safe staged rollout
370
+ if (options.isLozengeMigration) {
371
+ newAttributes.push('migration_fallback="lozenge"');
372
+ }
368
373
  var attributesText = newAttributes.length > 0 ? " ".concat(newAttributes.join(' ')) : '';
369
374
  var children = node.children.length > 0 ? sourceCode.getText().slice(node.openingElement.range[1], node.closingElement ? node.closingElement.range[0] : node.range[1]) : '';
370
375
  var componentName = options.preserveComponentName ? node.openingElement.name.name : options.isAvatarTag ? 'AvatarTag' : 'Tag';
@@ -136,6 +136,14 @@ var rule = (0, _createRule.createLintRule)({
136
136
  } else if (node.arguments.length > 1 && config.fallbackUsage === 'none') {
137
137
  if (node.arguments[0].type === 'Literal') {
138
138
  var _value = node.arguments[0].value;
139
+
140
+ /**
141
+ * This check allows ADS tokens to be passed in via UNSAFE_ignoreTokens and allow fallbacks even if `fallbackUsage` is set to 'none'.
142
+ * Temporary solution introduced to allow fallbacks for shape tokens in Jira during migration
143
+ */
144
+ if (_value && UNSAFE_ignoreTokens.has(_value)) {
145
+ return;
146
+ }
139
147
  context.report({
140
148
  messageId: 'tokenFallbackRestricted',
141
149
  node: node.arguments[1],
@@ -12,7 +12,7 @@ const rule = createLintRule({
12
12
  },
13
13
  messages: {
14
14
  updateAppearance: 'Update appearance value to new semantic value.',
15
- migrateTag: 'Non-bold <Lozenge> variants should migrate to <Tag> component.',
15
+ migrateTag: 'Non-bold <Lozenge> variants should migrate to <Tag> component. For safe, staged rollout, use the `migration_fallback="lozenge"` prop which renders as Lozenge when the feature flag is off.',
16
16
  manualReview: "Dynamic 'isBold' props require manual review before migration.",
17
17
  dynamicLozengeAppearance: "Dynamic 'appearance' prop values require manual review before migrating to Tag. Please verify the appearance value and manually convert it to the appropriate color prop value.",
18
18
  updateBadgeAppearance: 'Update Badge appearance value "{{oldValue}}" to new semantic value "{{newValue}}".',
@@ -354,6 +354,11 @@ const rule = createLintRule({
354
354
  if (options.isSimpleTag || options.isLozengeMigration) {
355
355
  newAttributes.push('isRemovable={false}');
356
356
  }
357
+
358
+ // Add migration_fallback="lozenge" for Lozenge migrations to enable safe staged rollout
359
+ if (options.isLozengeMigration) {
360
+ newAttributes.push('migration_fallback="lozenge"');
361
+ }
357
362
  const attributesText = newAttributes.length > 0 ? ` ${newAttributes.join(' ')}` : '';
358
363
  const children = node.children.length > 0 ? sourceCode.getText().slice(node.openingElement.range[1], node.closingElement ? node.closingElement.range[0] : node.range[1]) : '';
359
364
  const componentName = options.preserveComponentName ? node.openingElement.name.name : options.isAvatarTag ? 'AvatarTag' : 'Tag';
@@ -148,6 +148,14 @@ token('color.background.blanket');
148
148
  const {
149
149
  value
150
150
  } = node.arguments[0];
151
+
152
+ /**
153
+ * This check allows ADS tokens to be passed in via UNSAFE_ignoreTokens and allow fallbacks even if `fallbackUsage` is set to 'none'.
154
+ * Temporary solution introduced to allow fallbacks for shape tokens in Jira during migration
155
+ */
156
+ if (value && UNSAFE_ignoreTokens.has(value)) {
157
+ return;
158
+ }
151
159
  context.report({
152
160
  messageId: 'tokenFallbackRestricted',
153
161
  node: node.arguments[1],
@@ -15,7 +15,7 @@ var rule = createLintRule({
15
15
  },
16
16
  messages: {
17
17
  updateAppearance: 'Update appearance value to new semantic value.',
18
- migrateTag: 'Non-bold <Lozenge> variants should migrate to <Tag> component.',
18
+ migrateTag: 'Non-bold <Lozenge> variants should migrate to <Tag> component. For safe, staged rollout, use the `migration_fallback="lozenge"` prop which renders as Lozenge when the feature flag is off.',
19
19
  manualReview: "Dynamic 'isBold' props require manual review before migration.",
20
20
  dynamicLozengeAppearance: "Dynamic 'appearance' prop values require manual review before migrating to Tag. Please verify the appearance value and manually convert it to the appropriate color prop value.",
21
21
  updateBadgeAppearance: 'Update Badge appearance value "{{oldValue}}" to new semantic value "{{newValue}}".',
@@ -358,6 +358,11 @@ var rule = createLintRule({
358
358
  if (options.isSimpleTag || options.isLozengeMigration) {
359
359
  newAttributes.push('isRemovable={false}');
360
360
  }
361
+
362
+ // Add migration_fallback="lozenge" for Lozenge migrations to enable safe staged rollout
363
+ if (options.isLozengeMigration) {
364
+ newAttributes.push('migration_fallback="lozenge"');
365
+ }
361
366
  var attributesText = newAttributes.length > 0 ? " ".concat(newAttributes.join(' ')) : '';
362
367
  var children = node.children.length > 0 ? sourceCode.getText().slice(node.openingElement.range[1], node.closingElement ? node.closingElement.range[0] : node.range[1]) : '';
363
368
  var componentName = options.preserveComponentName ? node.openingElement.name.name : options.isAvatarTag ? 'AvatarTag' : 'Tag';
@@ -129,6 +129,14 @@ var rule = createLintRule({
129
129
  } else if (node.arguments.length > 1 && config.fallbackUsage === 'none') {
130
130
  if (node.arguments[0].type === 'Literal') {
131
131
  var _value = node.arguments[0].value;
132
+
133
+ /**
134
+ * This check allows ADS tokens to be passed in via UNSAFE_ignoreTokens and allow fallbacks even if `fallbackUsage` is set to 'none'.
135
+ * Temporary solution introduced to allow fallbacks for shape tokens in Jira during migration
136
+ */
137
+ if (_value && UNSAFE_ignoreTokens.has(_value)) {
138
+ return;
139
+ }
132
140
  context.report({
133
141
  messageId: 'tokenFallbackRestricted',
134
142
  node: node.arguments[1],
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.35.1",
4
+ "version": "13.36.1",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "@atlaskit/eslint-utils": "^2.0.0",
42
42
  "@atlaskit/icon": "^30.0.0",
43
- "@atlaskit/icon-lab": "^5.14.0",
43
+ "@atlaskit/icon-lab": "^5.15.0",
44
44
  "@atlaskit/tokens": "^10.1.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@typescript-eslint/utils": "^7.1.0",