Skip to content

Commit 3b42ab9

Browse files
authored
chore(JS): Spell out JS in snippet language headers (#3966)
1 parent 8306246 commit 3b42ab9

File tree

21 files changed

+83
-81
lines changed

21 files changed

+83
-81
lines changed

src/docs/product/integrations/integration-platform/ui-components/index.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Sentry Integration Platform provides developers with the ability to define U
1111

1212
The UI components are specified in the schema section of integration details. The required form of this schema is:
1313

14-
```js
14+
```javascript
1515
{
1616
"elements": [
1717
// Each element is a specification for a component the developer wants to use.
@@ -32,7 +32,7 @@ The Issue Link component displays "Link <Service> Issue" in the Issue side
3232

3333
### Schema
3434

35-
```js
35+
```javascript
3636
{
3737
"type": "issue-link",
3838
"link": {
@@ -56,7 +56,7 @@ A `FormField` can be one of three types (which behave like their HTML equivalent
5656

5757
## Select
5858

59-
```js
59+
```javascript
6060
{
6161
"type": "select",
6262
"label": <String>,
@@ -82,7 +82,7 @@ A `FormField` can be one of three types (which behave like their HTML equivalent
8282

8383
The request sent to the `uri` to load options is a `GET` request. The parameters are encoded into the query parameters as such:
8484

85-
```js
85+
```javascript
8686
{
8787
"installationId": <String>,
8888
"projectSlug": <String>,
@@ -100,7 +100,7 @@ The request sent to the `uri` to load options is a `GET` request. The parameters
100100

101101
Response from `uri`, when specified, _must_ be in the following format:
102102

103-
```js
103+
```javascript
104104
[
105105
{
106106
"label": <String>,
@@ -115,7 +115,7 @@ Response from `uri`, when specified, _must_ be in the following format:
115115

116116
### Schema
117117

118-
```js
118+
```javascript
119119
{
120120
"type": "text",
121121
"label": <String>,
@@ -136,7 +136,7 @@ Response from `uri`, when specified, _must_ be in the following format:
136136

137137
### Schema
138138

139-
```js
139+
```javascript
140140
{
141141
"type": "textarea",
142142
"label": <String>,
@@ -155,7 +155,7 @@ Response from `uri`, when specified, _must_ be in the following format:
155155

156156
### Example of a complete issue-link schema
157157

158-
```js
158+
```javascript
159159
{
160160
"elements": [
161161
{
@@ -203,7 +203,7 @@ This feature allows the developer to insert a link within a stack trace frame. T
203203

204204
### Schema
205205

206-
```js
206+
```javascript
207207
{
208208
"type": "stacktrace-link",
209209
"uri": <URI>,
@@ -220,7 +220,7 @@ This feature allows the developer to insert a link within a stack trace frame. T
220220

221221
### Example
222222

223-
```js
223+
```javascript
224224
"elements": [
225225
{
226226
"type": "stacktrace-link",
@@ -243,7 +243,7 @@ The request that is sent is a `POST` request, so all the information is stored i
243243

244244
### Schema
245245

246-
```js
246+
```javascript
247247
{
248248
"fields": <Object>,
249249
"installationId": <String>,
@@ -273,7 +273,7 @@ When creating or linking an issue, the response format _must_ have the following
273273

274274
### Schema
275275

276-
```js
276+
```javascript
277277
{
278278
"webUrl": <String>,
279279
"project": <String>,

src/includes/getting-started-config/javascript.vue.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ To initialize Sentry in your Vue application, add this to your `app.js`:
22

33
### Vue 2
44

5-
```js
5+
```javascript
66
import Vue from "vue";
77
import Router from "vue-router";
88
import * as Sentry from "@sentry/vue";
@@ -39,7 +39,7 @@ new Vue({
3939

4040
### Vue 3
4141

42-
```js
42+
```javascript
4343
import { createApp } from "vue";
4444
import { createRouter } from "vue-router";
4545
import * as Sentry from "@sentry/vue";
@@ -75,7 +75,7 @@ Additionally, Vue 3 allows you to use multiple apps with the same Sentry SDK ins
7575

7676
### Vue 3 - Multiple Apps
7777

78-
```js
78+
```javascript
7979
const appOne = Vue.createApp(App);
8080
const appTwo = Vue.createApp(App);
8181
const appThree = Vue.createApp(App);
@@ -87,7 +87,7 @@ Sentry.init({
8787

8888
### Vue 3 - Manual Initialization
8989

90-
```js
90+
```javascript
9191
import * as Sentry from "@sentry/vue";
9292

9393
// ...

src/includes/getting-started-verify/javascript.electron.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ One way to verify your setup is by intentionally causing an error that breaks yo
22

33
Calling an undefined function will throw an exception:
44

5-
```js
5+
```javascript
66
myUndefinedFunction();
77
```
88

src/includes/performance/configure-sample-rate/javascript.vue.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ If you want to track child components or use additional hooks to see more detail
4949
- `timeout` (defaults to `2000`) - Time in milliseconds dictating how long to wait until the tracked root activity is marked as finished and sent off to Sentry.
5050
- `hooks` (defaults to `['activate', 'mount', 'update']`) - List of hooks to keep track of during component lifecycle `'activate' | 'create' | 'destroy' | 'mount' | 'unmount' | 'update'`.
5151

52-
```js
52+
```javascript
5353
Sentry.init({
5454
Vue,
5555
tracesSampleRate: 0.1,

src/platforms/javascript/common/configuration/integrations/default.mdx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This integration wraps native APIs to capture breadcrumbs. By default, the Sentr
4646

4747
Available options:
4848

49-
```js
49+
```javascript
5050
{
5151
// Log calls to `console.log`, `console.debug`, etc
5252
console: boolean;
@@ -106,18 +106,20 @@ Available options:
106106
Here is a code example of how this could be implemented:
107107

108108
```javascript
109-
document.querySelector('#get-reviews-btn').addEventListener('click', async (event) => {
110-
const movie = event.target.dataset.title;
111-
try {
112-
const reviews = await fetchMovieReviews(movie);
113-
renderMovieReviews(reviews);
114-
} catch (e) {
115-
const fetchError = new Error(`Failed to fetch reviews for: ${movie}`);
116-
fetchError.cause = e;
117-
Sentry.captureException(fetchError);
118-
renderMovieReviewsError(fetchError);
119-
}
120-
});
109+
document
110+
.querySelector("#get-reviews-btn")
111+
.addEventListener("click", async event => {
112+
const movie = event.target.dataset.title;
113+
try {
114+
const reviews = await fetchMovieReviews(movie);
115+
renderMovieReviews(reviews);
116+
} catch (e) {
117+
const fetchError = new Error(`Failed to fetch reviews for: ${movie}`);
118+
fetchError.cause = e;
119+
Sentry.captureException(fetchError);
120+
renderMovieReviewsError(fetchError);
121+
}
122+
});
121123
```
122124

123125
### UserAgent

src/platforms/javascript/common/troubleshooting/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Starting with version `6.7.0` of the JavaScript SDK, you can use the `tunnel` op
8484

8585
To enable the `tunnel` option, provide either a relative or an absolute URL in your `Sentry.init` call. When you use a relative URL, it's relative to the current origin, and this is the form that we recommend. Using a relative URL will not trigger a preflight CORS request, so no events will be blocked, because the ad-blocker will not treat these events as third-party requests.
8686

87-
```js
87+
```javascript
8888
Sentry.init({
8989
dsn: "___PUBLIC_DSN___",
9090
tunnel: "/tunnel",
@@ -255,7 +255,7 @@ hub.withScope(function(scope) {
255255
Integrations are setup on the `Client`, if you need to deal with multiple clients and hubs you have to make sure to also do the integration handling correctly.
256256
Here is a working example of how to use multiple clients with multiple hubs running global integrations.
257257

258-
```js
258+
```javascript
259259
import * as Sentry from "@sentry/browser";
260260

261261
// Very happy integration that'll prepend and append very happy stick figure to the message

src/platforms/javascript/guides/react/configuration/integrations/react-router.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ We support integrations for React Router 3, 4 and 5.
2121

2222
To use the router integration, import and set a custom routing instrumentation using a custom history. Make sure you use a `Router` component combined with `createBrowserHistory` (or equivalent).
2323

24-
```js
24+
```javascript
2525
import { Router } from 'react-router-dom';
2626
import { createBrowserHistory } from 'history';
2727

@@ -66,7 +66,7 @@ To get parameterized transaction names (ex. `/teams/:teamid/user/:userid` instea
6666

6767
You can pass an array of route config objects as per [react-router-config](https://github.com/ReactTraining/react-router/tree/master/packages/react-router-config). to the instrumentation function call. You will also need to provide the `matchPath` function exported from the `react-router-dom` or `react-router` packages.
6868

69-
```js
69+
```javascript
7070
import { Route, Router, Switch, matchPath } from 'react-router-dom';
7171
import { createBrowserHistory } from 'history';
7272

@@ -108,7 +108,7 @@ render() {
108108

109109
Use the `withSentryRouting` higher order component to create a `SentryRoute` component that will update the match path on render.
110110

111-
```js
111+
```javascript
112112
import {Route, Router, Switch } from 'react-router-dom';
113113
import { createBrowserHistory } from 'history';
114114

@@ -149,7 +149,7 @@ render() {
149149

150150
To use the router integration, import and set a custom routing instrumentation and pass it the history, your routes and a match function. React Router v3 support is maintained for React Router >= 3.2.0 and < 4.0.0.
151151

152-
```js
152+
```javascript
153153
import * as Router from "react-router";
154154

155155
import * as Sentry from "@sentry/react";

src/platforms/javascript/guides/react/configuration/integrations/redux.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _(Available in version 5.20.0 and above)_
99

1010
Redux support is included in the `@sentry/react` package since version `5.20.0`. To apply Sentry to Redux, use `Sentry.createReduxEnhancer` at the same place that you initialize your Redux store.
1111

12-
```js
12+
```javascript
1313
import { createStore, compose } from "redux";
1414
import * as Sentry from "@sentry/react";
1515

@@ -26,7 +26,7 @@ const store = createStore(rootReducer, sentryReduxEnhancer);
2626

2727
If you have other enhancers or middleware such as `thunk`:
2828

29-
```js
29+
```javascript
3030
const store = createStore(
3131
rootReducer,
3232
compose(applyMiddleware(thunk), sentryReduxEnhancer)
@@ -43,7 +43,7 @@ Sentry uses a redux **enhancer**. Pass the enhancer, as indicated above. Don't p
4343

4444
By default Sentry SDKs normalize any context to a depth of 3, which in the case of sending Redux state you probably will want to increase that. You do so by passing `normalizeDepth` to the `Sentry.init` call:
4545

46-
```js
46+
```javascript
4747
Sentry.init({
4848
dsn: "___DSN___",
4949
normalizeDepth: 10, // Or however deep you want your state context to be.
@@ -64,7 +64,7 @@ We advise against sending sensitive information to Sentry, but if you do, we wil
6464

6565
: Used to remove sensitive information from actions. The first parameter passed to the function is the Redux action. Return `null` to not send the action to Sentry. By default we send all actions.
6666

67-
```js
67+
```javascript
6868
const sentryReduxEnhancer = Sentry.createReduxEnhancer({
6969
actionTransformer: action => {
7070
if (action.type === "GOVERNMENT_SECRETS") {
@@ -88,7 +88,7 @@ const sentryReduxEnhancer = Sentry.createReduxEnhancer({
8888

8989
: Used to remove sensitive information from state. The first parameter passed to the function is the Redux state. Return `null` to not attach the state to events sent to Sentry. Note that if you choose not to send state to Sentry, your errors might not have the latest version of the state attached. By default, we attach all state changes.
9090

91-
```js
91+
```javascript
9292
const sentryReduxEnhancer = Sentry.createReduxEnhancer({
9393
stateTransformer: state => {
9494
if (state.topSecret.doNotSend) {
@@ -119,7 +119,7 @@ const sentryReduxEnhancer = Sentry.createReduxEnhancer({
119119

120120
: Called on every state update, configure the Sentry Scope with the Redux state. The first parameter is the scope, which is the same scope instance that you would get when you call `Sentry.configureScope`, and the second parameter is the latest Redux state.
121121

122-
```js
122+
```javascript
123123
const sentryReduxEnhancer = Sentry.createReduxEnhancer({
124124
configureScopeWithState: (scope, state) => {
125125
// Set tag if the user is using imperial units.

src/platforms/javascript/guides/vue/configuration/integrations/vue-router.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Sentry built the new tracing capabilities into the original Vue error handler in
2222

2323
The most basic configuration for tracing your Vue app, which would track only the top-level component, looks like this:
2424

25-
```js
25+
```javascript
2626
import Vue from "vue";
2727
import * as Sentry from "@sentry/browser";
2828
import { Integrations } from "@sentry/tracing";
@@ -39,7 +39,7 @@ Sentry.init({
3939

4040
If you want to track child components, and see more details about the rendering process, configure the integration to track them all:
4141

42-
```js
42+
```javascript
4343
Sentry.init({
4444
Vue,
4545
trackComponents: true,
@@ -48,7 +48,7 @@ Sentry.init({
4848

4949
Or, you can choose more granularity:
5050

51-
```js
51+
```javascript
5252
Sentry.init({
5353
Vue,
5454
integrations: [new Integrations.BrowserTracing()],
@@ -64,7 +64,7 @@ Sentry.init({
6464

6565
If you want to know if some components are, for example, removed during the initial page load, add a `destroy` hook to the default:
6666

67-
```js
67+
```javascript
6868
Sentry.init({
6969
Vue,
7070
integrations: [new Integrations.BrowserTracing()],
@@ -82,7 +82,7 @@ Sentry.init({
8282
You can specify how long a top-level activity should wait for the last component to render.
8383
Every new rendering cycle is debouncing the timeout, and it starts counting from the beginning. Once the timeout is reached, tracking is completed, and all the information is sent to Sentry.
8484

85-
```js
85+
```javascript
8686
Sentry.init({
8787
Vue,
8888
integrations: [new Integrations.BrowserTracing()],
@@ -93,7 +93,7 @@ Sentry.init({
9393

9494
**Configuration**
9595

96-
```js
96+
```javascript
9797
tracingOptions: {
9898
/**
9999
* Decides whether to track components by hooking into its lifecycle methods.
@@ -120,7 +120,7 @@ tracingOptions: {
120120

121121
If you are using Vue Router, you can use our provided integration for better transaction names. Here is a full example how to use it:
122122

123-
```js
123+
```javascript
124124
import Vue from "vue";
125125
import App from "./App";
126126
import * as Sentry from "@sentry/vue";

0 commit comments

Comments
 (0)