Skip to content

Conversation

olliecurtis
Copy link
Member

This PR makes some big changes to how the Backpack token linting works to move from bpk-tokens to bpk-foundations-web as tokens is deprecated.

Also in order to simplify and switch from tokens to foundations, based on the deprecation of support for React Native and Backpack React Native, removed the linting for Backpack React Native <- This was to avoid bundling two packages and making the big changes twice

Changes:

  • Moves from bpk-tokens to bpk-foundations-web
  • Updated tests

Use Components

  • Removes the React Native config from the use-components rules and the React Native auto importer components

Use Tokens

  • Removed the React Native config and imports of RN tokens
  • Removed the spacing linter as spacing tokens are no longer available in JS and only exist through the CSS which is covered by stylelint-config-skyscanner
  • Updated the logic to take into account now that we have semantic tokens which means if you use a base colour or rgb value of a colour it will prompt you to check for the correct semantic token on the Backpack documentation site as there could be multiple appropriate tokens available to use depending on context instead of just taking the first token

@@ -59,44 +48,7 @@ const BORDER_PROPS = [
'borderWidth',
];

const SPACING_PROPS = [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't track spacing now as the Backpack variables are no longer in JS and you can only set them via CSS


if (expectedToken) {
const matchedTokens = _.filter(COLORS, { value: color.toRgbString() });
console.log('matchedTokens', matchedTokens[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this log statement?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch! That was left over from debugging

@olliecurtis olliecurtis force-pushed the ARGG-799-migrate-from-bpk-tokens branch from eebe232 to 11ab711 Compare October 25, 2023 14:33
@olliecurtis olliecurtis force-pushed the ARGG-799-migrate-from-bpk-tokens branch from 11ab711 to 0217b74 Compare October 25, 2023 14:44
@olliecurtis olliecurtis requested a review from xalechez October 25, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants