Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
export function kebabify(str: string) {
|
||||
return str.replace(/\/|\s/g, '-').replace(/\(|\)|\[|\]/g, '')
|
||||
return str.replace(/\/|\s/g, "-").replace(/\(|\)|\[|\]/g, "")
|
||||
}
|
||||
|
||||
export function ignoreStyles(mode: { name: string }) {
|
||||
if (mode.name === 'Style') {
|
||||
if (mode.name === "Style") {
|
||||
// Ignore Figma Styles, we only want to process variables.
|
||||
// But the exported variables.json includes Figma Styles too.
|
||||
return false
|
||||
@@ -12,7 +12,7 @@ export function ignoreStyles(mode: { name: string }) {
|
||||
}
|
||||
|
||||
// Some tokens are the same for all themes. Group them into this theme.
|
||||
export const FALLBACK_THEME = 'base'
|
||||
export const FALLBACK_THEME = "base"
|
||||
|
||||
// The variables exported from Figma are not grouped by theme.
|
||||
// We used this function to help us group by theme.
|
||||
@@ -24,10 +24,10 @@ export function getThemeForToken(
|
||||
themes: Map<string, unknown>
|
||||
) {
|
||||
// If the given value is an object and has a name property, use that as comparison value.
|
||||
const compare = typeof token === 'string' ? token : token.name
|
||||
const compare = typeof token === "string" ? token : token.name
|
||||
const theme = Array.from(themes.keys()).find((theme) => {
|
||||
// Match against "theme/", use that if it matches
|
||||
if (compare.indexOf(theme + '/') >= 0) {
|
||||
if (compare.indexOf(theme + "/") >= 0) {
|
||||
return theme
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user