Skip to content

Commit 396e247

Browse files
ref(prettier): Configure prettier to format mdx w/ defaults (#6872)
* ref(prettier): Configure prettier to format mdx w/ defaults Most of our users will be using the default prettier config, so we want to format our codeblocks using this default * style(lint): Auto commit lint changes --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent de0ae08 commit 396e247

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@
106106
"lint:links": "yarn run hyperlink public/",
107107
"lint:eslint": "eslint \"src/**/*.{ts,tsx,js,jsx}\"",
108108
"lint:eslint:fix": "eslint --fix \"src/**/*.{ts,tsx,js,jsx}\"",
109-
"lint:prettier": "prettier --check \"./src/**/*.{ts,tsx,js,jsx}\"",
110-
"lint:prettier:fix": "prettier --write \"./src/**/*.{ts,tsx,js,jsx}\"",
109+
"lint:prettier": "prettier --check \"./src/**/*.{md,mdx,ts,tsx,js,jsx}\"",
110+
"lint:prettier:fix": "prettier --write \"./src/**/*.{md,mdx,ts,tsx,js,jsx}\"",
111111
"start": "yarn run develop",
112112
"format": "prettier --write \"src/**/*.js\"",
113113
"remove-preview-deployments": "ts-node scripts/remove-preview-deployments.ts",

prettier.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,17 @@ module.exports = {
1212
trailingComma: 'es5',
1313
useTabs: false,
1414
arrowParens: 'avoid',
15+
overrides: [
16+
// For mdx files we use the default prettier configs for codeblocks,
17+
// since at least for javascript, this is what most people use
18+
{
19+
files: ['*.md', '*.mdx'],
20+
options: {
21+
bracketSpacing: true,
22+
printWidth: 80,
23+
singleQuote: false,
24+
arrowParens: 'always',
25+
},
26+
},
27+
],
1528
};

src/platforms/javascript/common/session-replay/configuration.mdx

+3-7
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,9 @@ If you want to capture additional headers, you'll have to configure them with th
5858

5959
```javascript
6060
new Replay({
61-
networkDetailAllowUrls: ['https://my-website.com/api'],
62-
networkRequestHeaders: [
63-
"Cache-Control",
64-
],
65-
networkResponseHeaders: [
66-
"Referrer-Policy",
67-
],
61+
networkDetailAllowUrls: ["https://my-website.com/api"],
62+
networkRequestHeaders: ["Cache-Control"],
63+
networkResponseHeaders: ["Referrer-Policy"],
6864
});
6965
```
7066

0 commit comments

Comments
 (0)