-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tokens): provide autofix for all global tokens (#763)
* feat(tokens): provide autofix for global non-color tokens * refactor(getDefaultDeclarationString helper): rename to getImportPath * feat(tokens): handle color tokens autofix * test(tokens): add tests * refactor(tokens) * refactor(tokens): rename rule * feat(tokens): update temp_dev_tbd token to t_temp_dev_tbd * docs: update description Co-authored-by: Eric Olkowski <[email protected]> --------- Co-authored-by: Eric Olkowski <[email protected]>
- Loading branch information
1 parent
4d7fecc
commit f5d32ce
Showing
22 changed files
with
1,332 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './configs'; | ||
export * from './ruleCuration'; | ||
export * from './ruleCustomization' | ||
export * from "./configs"; | ||
export * from "./ruleCuration"; | ||
export * from "./ruleCustomization"; | ||
export * from "./tokenLists"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
packages/eslint-plugin-pf-codemods/src/rules/helpers/getDefaultDeclarationString.ts
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
packages/eslint-plugin-pf-codemods/src/rules/helpers/getImportPath.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
ImportDefaultSpecifierWithParent, | ||
ImportSpecifierWithParent, | ||
} from "./interfaces"; | ||
|
||
/** Gets the import path string for an import specifier (named or default) */ | ||
export function getImportPath( | ||
importSpecifier: ImportDefaultSpecifierWithParent | ImportSpecifierWithParent | ||
) { | ||
return importSpecifier?.parent?.source.value?.toString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/eslint-plugin-pf-codemods/src/rules/v6/tokensUpdate/tokens-update.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
### tokens-update | ||
|
||
We have updated our CSS tokens. About half of our tokens have been replaced with newer ones. | ||
|
||
- this rule provides an autofix for global non color tokens | ||
- global color tokens will be replaced with a temporary hot pink color token **that must be manually replaced** (`t_temp_dev_tbd` react token or `--pf-t--temp--dev--tbd` CSS variable) | ||
- other non-global (component or chart) tokens need to be replaced manually | ||
|
||
To find a suitable replacement token, check our [v6 token documentation](https://staging-v6.patternfly.org/tokens/all-patternfly-tokens). | ||
|
||
#### Examples | ||
|
||
In: | ||
|
||
```jsx | ||
%inputExample% | ||
``` | ||
|
||
Out: | ||
|
||
```jsx | ||
%outputExample% | ||
``` |
Oops, something went wrong.