@atlaskit/eslint-plugin-design-system 8.15.3 → 8.15.5

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,18 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 8.15.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#63526](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63526) [`cae958047771`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cae958047771) - Internal change to how typography tokens are imported. There is no expected behaviour change.
8
+ - Updated dependencies
9
+
10
+ ## 8.15.4
11
+
12
+ ### Patch Changes
13
+
14
+ - [#63768](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63768) [`56342fba2b72`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/56342fba2b72) - Fixes an issue with the `use-drawer-label` rule where named imports such as type imports from `@atlaskit/drawer` could incorrectly report an error.
15
+
3
16
  ## 8.15.3
4
17
 
5
18
  ### Patch Changes
@@ -654,11 +654,16 @@ css`
654
654
 
655
655
  This rule comes with options to aid in migrating to design tokens.
656
656
 
657
- #### shouldEnforceFallbacks
657
+ #### fallbackUsage
658
+
659
+ - `forced`: Fallback values must always be provided
660
+ - `none`: Fallback values must never be provided. (Fixer will remove is provided)
661
+ - `optional`: Fallbacks are optional
662
+
663
+ #### shouldEnforceFallbacks (deprecated)
658
664
 
659
665
  When `true` the rule will mark token function usage as violations when fallbacks aren't defined.
660
666
  When `false` the rule will mark token function usage as violations when fallbacks are defined.
661
- When `'optional'` the rule will not mark token function usage as violations when fallbacks are not defined.
662
667
 
663
668
  ## no-unsupported-drag-and-drop-libraries
664
669
 
@@ -22,7 +22,7 @@ var isFontFamily = exports.isFontFamily = function isFontFamily(node) {
22
22
  var isCodeFontFamily = exports.isCodeFontFamily = function isCodeFontFamily(node) {
23
23
  return (0, _eslintCodemodUtils.isNodeOfType)(node, 'CallExpression') && (0, _eslintCodemodUtils.isNodeOfType)(node.callee, 'Identifier') && (node.callee.name === 'codeFontFamily' || node.callee.name === 'getCodeFontFamily');
24
24
  };
25
- var typographyValueToToken = exports.typographyValueToToken = Object.fromEntries(_tokensRaw.typography
25
+ var typographyValueToToken = exports.typographyValueToToken = Object.fromEntries(_tokensRaw.typographyAdg3
26
26
  // we're filtering here to remove the `font` tokens.
27
27
  .filter(function (t) {
28
28
  return t.attributes.group !== 'typography';
@@ -31,7 +31,7 @@ var typographyValueToToken = exports.typographyValueToToken = Object.fromEntries
31
31
  // This allows us to look up values specific to a property
32
32
  // (so as not to mix tokens with overlapping values e.g. font size and line height both have tokens for 16px)
33
33
  var tokenGroup = currentToken.attributes.group;
34
- return [tokenGroup, Object.fromEntries(_tokensRaw.typography.map(function (token) {
34
+ return [tokenGroup, Object.fromEntries(_tokensRaw.typographyAdg3.map(function (token) {
35
35
  return token.attributes.group === tokenGroup ? [token.value.replaceAll("\"", "'"), token.name] : [];
36
36
  }).filter(function (token) {
37
37
  return token.length;
@@ -35,8 +35,10 @@ var rule = (0, _createRule.createLintRule)({
35
35
  var defaultImport = node.specifiers.filter(function (spec) {
36
36
  return spec.type === 'ImportDefaultSpecifier';
37
37
  });
38
- var local = defaultImport[0].local;
39
- contextLocalIdentifier.push(local.name);
38
+ if (defaultImport.length) {
39
+ var local = defaultImport[0].local;
40
+ contextLocalIdentifier.push(local.name);
41
+ }
40
42
  }
41
43
  }
42
44
  },
@@ -1,5 +1,5 @@
1
1
  import { isNodeOfType } from 'eslint-codemod-utils';
2
- import { typography as typographyTokens } from '@atlaskit/tokens/tokens-raw';
2
+ import { typographyAdg3 as typographyTokens } from '@atlaskit/tokens/tokens-raw';
3
3
  const typographyProperties = ['fontSize', 'fontWeight', 'fontFamily', 'lineHeight'];
4
4
  export const isTypographyProperty = propertyName => {
5
5
  return typographyProperties.includes(propertyName);
@@ -27,10 +27,12 @@ const rule = createLintRule({
27
27
  if (node.source.value === '@atlaskit/drawer') {
28
28
  if (node.specifiers.length) {
29
29
  const defaultImport = node.specifiers.filter(spec => spec.type === 'ImportDefaultSpecifier');
30
- const {
31
- local
32
- } = defaultImport[0];
33
- contextLocalIdentifier.push(local.name);
30
+ if (defaultImport.length) {
31
+ const {
32
+ local
33
+ } = defaultImport[0];
34
+ contextLocalIdentifier.push(local.name);
35
+ }
34
36
  }
35
37
  }
36
38
  },
@@ -1,5 +1,5 @@
1
1
  import { isNodeOfType } from 'eslint-codemod-utils';
2
- import { typography as typographyTokens } from '@atlaskit/tokens/tokens-raw';
2
+ import { typographyAdg3 as typographyTokens } from '@atlaskit/tokens/tokens-raw';
3
3
  var typographyProperties = ['fontSize', 'fontWeight', 'fontFamily', 'lineHeight'];
4
4
  export var isTypographyProperty = function isTypographyProperty(propertyName) {
5
5
  return typographyProperties.includes(propertyName);
@@ -29,8 +29,10 @@ var rule = createLintRule({
29
29
  var defaultImport = node.specifiers.filter(function (spec) {
30
30
  return spec.type === 'ImportDefaultSpecifier';
31
31
  });
32
- var local = defaultImport[0].local;
33
- contextLocalIdentifier.push(local.name);
32
+ if (defaultImport.length) {
33
+ var local = defaultImport[0].local;
34
+ contextLocalIdentifier.push(local.name);
35
+ }
34
36
  }
35
37
  }
36
38
  },
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.15.3",
4
+ "version": "8.15.5",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"