Skip to content

Commit e14edff

Browse files
authored
tools: run prettier on mdx (#92308)
Execute and run prettier on mdx files.
1 parent dbc7576 commit e14edff

File tree

3 files changed

+49
-49
lines changed

3 files changed

+49
-49
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ repos:
121121
entry: ./node_modules/.bin/stylelint --quiet
122122

123123
- id: prettier
124-
name: prettier (yaml, markdown, ts, tsx, js, jsx, css)
124+
name: prettier (yaml, ts, tsx, js, jsx, css, mdx, markdown)
125125
language: system
126-
types_or: [yaml, markdown, ts, tsx, javascript, jsx, css]
126+
types_or: [yaml, ts, tsx, javascript, jsx, css, mdx, markdown]
127127
entry: ./node_modules/.bin/prettier --log-level=error --write
128128
# https://pre-commit.com/#regular-expressions
129129
exclude: |

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@
257257
"lint": "yarn lint:prettier && yarn lint:js && yarn lint:css",
258258
"lint:js": "eslint",
259259
"lint:css": "stylelint '**/*.[jt]sx'",
260-
"lint:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --check --log-level=error",
260+
"lint:prettier": "prettier \"**/*.md(x)?\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --check --log-level=error",
261261
"fix": "yarn fix:prettier && yarn fix:eslint",
262262
"fix:eslint": "eslint --fix",
263-
"fix:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --write --log-level=error",
263+
"fix:prettier": "prettier \"**/*.md(x)?\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --write --log-level=error",
264264
"dev": "(yarn check --verify-tree || yarn install --check-files) && sentry devserver",
265265
"dev-ui": "yarn dev-ui-rspack",
266266
"dev-ui-webpack": "SENTRY_UI_DEV_ONLY=1 SENTRY_WEBPACK_PROXY_PORT=7999 SENTRY_UI_HOT_RELOAD=1 webpack serve",

static/app/styles/colors.mdx

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ export const SideBySide = styled('ul')`
7777
margin-bottom: 0;
7878
}
7979
80-
display: grid;
81-
grid-template-columns: 1fr 1fr;
82-
gap: ${space(2)};
80+
display: grid;
81+
grid-template-columns: 1fr 1fr;
82+
gap: ${space(2)};
8383
`;
8484

8585
export const PalettePanel = styled(Panel)`
@@ -90,18 +90,18 @@ export const PalettePanelItem = styled(PanelItem)`
9090
flex-direction: column;
9191
gap: ${space(0.5)};
9292
93-
&:first-child {
94-
border-radius: ${p => p.theme.borderRadius} ${p => p.theme.borderRadius} 0 0;
95-
}
96-
&:last-child {
97-
border-radius: 0 0 ${p => p.theme.borderRadius} ${p => p.theme.borderRadius};
98-
}
99-
&:first-child:last-child {
100-
border-radius: ${p => p.theme.borderRadius};
101-
}
93+
&:first-child {
94+
border-radius: ${p => p.theme.borderRadius} ${p => p.theme.borderRadius} 0 0;
95+
}
96+
&:last-child {
97+
border-radius: 0 0 ${p => p.theme.borderRadius} ${p => p.theme.borderRadius};
98+
}
99+
&:first-child:last-child {
100+
border-radius: ${p => p.theme.borderRadius};
101+
}
102102
103-
background: ${p => p.theme[p.color]};
104-
color: ${p => p.theme[p.text]};
103+
background: ${p => p.theme[p.color]};
104+
color: ${p => p.theme[p.text]};
105105
`;
106106

107107
export const ExampleImg = styled('img')`
@@ -147,41 +147,41 @@ export const ExampleCardGrid = styled('figcaption')`
147147
export const ExampleCard = ({imgSrc, text, isPositive}) => (
148148
<figure>
149149
<ExampleImg src={imgSrc} />
150-
<ExampleCardGrid>
151-
{isPositive ? <PositiveLabel /> : <NegativeLabel />}
152-
<span>{text}</span>
153-
</ExampleCardGrid>
154-
</figure>
150+
<ExampleCardGrid>
151+
{isPositive ? <PositiveLabel /> : <NegativeLabel />}
152+
<span>{text}</span>
153+
</ExampleCardGrid>
154+
</figure>
155155
);
156156

157157
export const ColorPalette = ({name, palette}) => {
158158
const theme = useTheme();
159159

160-
return (
161-
<SideBySide>
162-
{palette.map((section, i) => {
163-
return (
164-
<li key={`${name}-${i}`}>
165-
<PalettePanel typeof="ul">
166-
{section.map((color, index) => {
167-
return (
168-
<PalettePanelItem
169-
key={`${name}-${color.color}-${index}`}
170-
color={color.color}
171-
text={color.text}
172-
>
173-
<strong>{color.color}</strong>
174-
{theme[color.color]}
175-
</PalettePanelItem>
176-
);
177-
})}
178-
</PalettePanel>
179-
</li>
180-
);
181-
})}
182-
</SideBySide>
183-
);
184-
}
160+
return (
161+
162+
<SideBySide>
163+
{palette.map((section, i) => {
164+
return (
165+
<li key={`${name}-${i}`}>
166+
<PalettePanel typeof="ul">
167+
{section.map((color, index) => {
168+
return (
169+
<PalettePanelItem
170+
key={`${name}-${color.color}-${index}`}
171+
color={color.color}
172+
text={color.text}
173+
>
174+
<strong>{color.color}</strong>
175+
{theme[color.color]}
176+
</PalettePanelItem>
177+
);
178+
})}
179+
</PalettePanel>
180+
</li>
181+
);
182+
})}
183+
</SideBySide>
184+
); }
185185

186186
# Colors
187187

@@ -199,7 +199,7 @@ Here are the recommended use cases:
199199
- **Gray 400:** body text, input values & labels.
200200
- **Gray 300:** input placeholders, inactive/disabled inputs and buttons, chart labels, supplemental and non-essential text
201201
- **Gray 200:** borders around large elements (cards, panels, dialogs, tables).
202-
- **Gray 100:** dividers and borders around small elements (buttons, form inputs). */}
202+
- **Gray 100:** dividers and borders around small elements (buttons, form inputs). \*/}
203203

204204
<Storybook.ThemeToggle>
205205
<ColorPalette name="grays" palette={GRAY_PALETTES} />

0 commit comments

Comments
 (0)