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 @@
|
||||
/* eslint-disable formatjs/no-literal-string-in-jsx */
|
||||
import copy from 'copy-to-clipboard'
|
||||
import copy from "copy-to-clipboard"
|
||||
|
||||
import { kebabify } from '../../generate/utils'
|
||||
import { kebabify } from "../../generate/utils"
|
||||
|
||||
import tableStyles from './tokens.module.css'
|
||||
import tableStyles from "./tokens.module.css"
|
||||
|
||||
type ThemeValue = {
|
||||
resolved: string | number
|
||||
@@ -24,15 +24,15 @@ export function Shadow({ theme }: ShadowProps) {
|
||||
// Filter shadow tokens
|
||||
const shadowTokens: Theme = {}
|
||||
for (const [k, v] of Object.entries(theme)) {
|
||||
if (k.startsWith('BoxShadow-')) {
|
||||
if (k.startsWith("BoxShadow-")) {
|
||||
shadowTokens[k] = v as ThemeValue
|
||||
}
|
||||
}
|
||||
|
||||
// Sort by level
|
||||
const sortedTokens = Object.entries(shadowTokens).sort((a, b) => {
|
||||
const aLevel = parseInt(a[0].match(/\d+/)?.[0] || '0')
|
||||
const bLevel = parseInt(b[0].match(/\d+/)?.[0] || '0')
|
||||
const aLevel = parseInt(a[0].match(/\d+/)?.[0] || "0")
|
||||
const bLevel = parseInt(b[0].match(/\d+/)?.[0] || "0")
|
||||
return aLevel - bLevel
|
||||
})
|
||||
|
||||
@@ -53,8 +53,8 @@ export function Shadow({ theme }: ShadowProps) {
|
||||
<tbody>
|
||||
{sortedTokens.map(([k, v]) => {
|
||||
const shadowValue =
|
||||
typeof v.resolved === 'string' ? v.resolved : ''
|
||||
const level = k.match(/\d+/)?.[0] || '0'
|
||||
typeof v.resolved === "string" ? v.resolved : ""
|
||||
const level = k.match(/\d+/)?.[0] || "0"
|
||||
|
||||
return (
|
||||
<tr key={k} className={tableStyles.tableRow}>
|
||||
@@ -80,8 +80,8 @@ export function Shadow({ theme }: ShadowProps) {
|
||||
}}
|
||||
title="Click to copy"
|
||||
style={{
|
||||
fontSize: '0.75rem',
|
||||
wordBreak: 'break-all',
|
||||
fontSize: "0.75rem",
|
||||
wordBreak: "break-all",
|
||||
}}
|
||||
>
|
||||
{shadowValue}
|
||||
|
||||
Reference in New Issue
Block a user