@atlaskit/eslint-plugin-design-system 10.4.0 → 10.4.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
+ ## 10.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#103215](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103215)
8
+ [`1108a9b46be2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1108a9b46be2) -
9
+ Fixed an issue with the `use-tokens-typography` rule where font family properties that were
10
+ already using a token could be misinterpreted and cause the font family property to be removed.
11
+
3
12
  ## 10.4.0
4
13
 
5
14
  ### Minor Changes
@@ -95,6 +95,12 @@ var StyleObject = exports.StyleObject = {
95
95
  var fontFamilyNode = _astNodes.Object.getEntryByPropertyName(node, 'fontFamily');
96
96
  var fontFamilyRaw = fontFamilyNode && (0, _utils.getValueForPropertyNode)(fontFamilyNode, context);
97
97
  var fontFamilyValue = fontFamilyRaw && (0, _utils.normaliseValue)('fontFamily', fontFamilyRaw) || undefined;
98
+
99
+ // If font family is already a token, we remove and re-add it
100
+ // Only need to do this for non-default font stacks as the defaults can be safely removed
101
+ if (fontFamilyValue && fontFamilyValue.includes('font.family.') && !(fontFamilyValue.includes('font.family.heading') || fontFamilyValue.includes('font.family.body'))) {
102
+ fontFamilyValue = undefined;
103
+ }
98
104
  var fontFamilyToAdd;
99
105
  // If font family uses the Charlie font we can't replace; exit
100
106
  if (fontFamilyValue) {
@@ -88,7 +88,13 @@ export const StyleObject = {
88
88
  // -- Font family --
89
89
  const fontFamilyNode = ASTObject.getEntryByPropertyName(node, 'fontFamily');
90
90
  const fontFamilyRaw = fontFamilyNode && getValueForPropertyNode(fontFamilyNode, context);
91
- const fontFamilyValue = fontFamilyRaw && normaliseValue('fontFamily', fontFamilyRaw) || undefined;
91
+ let fontFamilyValue = fontFamilyRaw && normaliseValue('fontFamily', fontFamilyRaw) || undefined;
92
+
93
+ // If font family is already a token, we remove and re-add it
94
+ // Only need to do this for non-default font stacks as the defaults can be safely removed
95
+ if (fontFamilyValue && fontFamilyValue.includes('font.family.') && !(fontFamilyValue.includes('font.family.heading') || fontFamilyValue.includes('font.family.body'))) {
96
+ fontFamilyValue = undefined;
97
+ }
92
98
  let fontFamilyToAdd;
93
99
  // If font family uses the Charlie font we can't replace; exit
94
100
  if (fontFamilyValue) {
@@ -89,6 +89,12 @@ export var StyleObject = {
89
89
  var fontFamilyNode = ASTObject.getEntryByPropertyName(node, 'fontFamily');
90
90
  var fontFamilyRaw = fontFamilyNode && getValueForPropertyNode(fontFamilyNode, context);
91
91
  var fontFamilyValue = fontFamilyRaw && normaliseValue('fontFamily', fontFamilyRaw) || undefined;
92
+
93
+ // If font family is already a token, we remove and re-add it
94
+ // Only need to do this for non-default font stacks as the defaults can be safely removed
95
+ if (fontFamilyValue && fontFamilyValue.includes('font.family.') && !(fontFamilyValue.includes('font.family.heading') || fontFamilyValue.includes('font.family.body'))) {
96
+ fontFamilyValue = undefined;
97
+ }
92
98
  var fontFamilyToAdd;
93
99
  // If font family uses the Charlie font we can't replace; exit
94
100
  if (fontFamilyValue) {
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.0",
4
+ "version": "10.4.1",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {