Skip to content

Commit 40dc666

Browse files
committed
docs: Trim trailing commas in JavaScript code examples according to the style guide. Fixes #9617
1 parent 0e7f2a6 commit 40dc666

File tree

73 files changed

+1733
-1730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1733
-1730
lines changed

docs/pages/docs.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ cube(`monthly_retention`, {
2525
dimensions: {
2626
months_since_signup: {
2727
sql: `DATEDIFF('month', ${CUBE}.signup_month, ${CUBE}.activity_month)`,
28-
type: `number`,
28+
type: `number`
2929
},
3030

3131
signup_date: {
3232
sql: `(signup_month AT TIME ZONE 'America/Los_Angeles')`,
33-
type: `time`,
34-
},
35-
},
36-
});
33+
type: `time`
34+
}
35+
}
36+
})
3737
```
3838

3939
#### With tabs
@@ -61,15 +61,15 @@ cube(`monthly_retention`, {
6161
dimensions: {
6262
months_since_signup: {
6363
sql: `DATEDIFF('month', ${CUBE}.signup_month, ${CUBE}.activity_month)`,
64-
type: `number`,
64+
type: `number`
6565
},
6666

6767
signup_date: {
6868
sql: `(signup_month AT TIME ZONE 'America/Los_Angeles')`,
69-
type: `time`,
70-
},
71-
},
72-
});
69+
type: `time`
70+
}
71+
}
72+
})
7373
```
7474

7575
</CodeTabs>

docs/pages/product/apis-integrations/graphql-api.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,22 @@ cube(`orders`, {
6868

6969
measures: {
7070
count: {
71-
type: `count`,
72-
},
71+
type: `count`
72+
}
7373
},
7474

7575
dimensions: {
7676
status: {
7777
sql: `status`,
78-
type: `string`,
78+
type: `string`
7979
},
8080

8181
created_at: {
8282
sql: `created_at`,
83-
type: `time`,
84-
},
85-
},
86-
});
83+
type: `time`
84+
}
85+
}
86+
})
8787
```
8888

8989
</CodeTabs>

docs/pages/product/apis-integrations/recipes/drilldowns.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,38 @@ cube(`orders`, {
2323
joins: {
2424
users: {
2525
relationship: `many_to_one`,
26-
sql: `${CUBE}.user_id = ${users.id}`,
26+
sql: `${CUBE}.user_id = ${users.id}`
2727
},
2828

2929
products: {
3030
relationship: `many_to_one`,
31-
sql: `${CUBE}.product_id = ${products.id}`,
32-
},
31+
sql: `${CUBE}.product_id = ${products.id}`
32+
}
3333
},
3434

3535
measures: {
3636
count: {
3737
type: `count`,
3838
// Here we define all possible properties we might want
3939
// to "drill down" on from our front-end
40-
drill_members: [id, status, products.name, users.city],
41-
},
40+
drill_members: [id, status, products.name, users.city]
41+
}
4242
},
4343

4444
dimensions: {
4545
id: {
4646
type: `number`,
4747
sql: `id`,
4848
primary_key: true,
49-
public: true,
49+
public: true
5050
},
5151

5252
status: {
5353
type: `string`,
54-
sql: `status`,
55-
},
56-
},
57-
});
54+
sql: `status`
55+
}
56+
}
57+
})
5858
```
5959

6060
```yaml

docs/pages/product/apis-integrations/recipes/getting-unique-values-for-a-field.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ cube(`users`, {
3535
dimensions: {
3636
city: {
3737
sql: `city`,
38-
type: `string`,
38+
type: `string`
3939
},
4040

4141
state: {
4242
sql: `state`,
43-
type: `string`,
44-
},
45-
},
46-
});
43+
type: `string`
44+
}
45+
}
46+
})
4747
```
4848

4949
</CodeTabs>

docs/pages/product/apis-integrations/recipes/pagination.mdx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ cube(`orders`, {
3838

3939
measures: {
4040
count: {
41-
type: `count`,
42-
},
41+
type: `count`
42+
}
4343
},
4444

4545
dimensions: {
4646
number: {
4747
sql: `number`,
48-
type: `number`,
48+
type: `number`
4949
},
5050

5151
created_at: {
5252
sql: `created_at`,
53-
type: `time`,
54-
},
55-
},
56-
});
53+
type: `time`
54+
}
55+
}
56+
})
5757
```
5858

5959
</CodeTabs>
@@ -104,53 +104,53 @@ We have received five orders per query and can use them as we want.
104104

105105
[
106106
{
107-
"orders.count": "10000",
108-
},
109-
];
107+
"orders.count": "10000"
108+
}
109+
]
110110
```
111111

112112
```javascript
113113
// The first five orders:
114114

115115
[
116116
{
117-
"orders.number": 1,
117+
"orders.number": 1
118118
},
119119
{
120-
"orders.number": 2,
120+
"orders.number": 2
121121
},
122122
{
123-
"orders.number": 3,
123+
"orders.number": 3
124124
},
125125
{
126-
"orders.number": 4,
126+
"orders.number": 4
127127
},
128128
{
129-
"orders.number": 5,
130-
},
131-
];
129+
"orders.number": 5
130+
}
131+
]
132132
```
133133

134134
```javascript
135135
// The next five orders:
136136

137137
[
138138
{
139-
"orders.number": 6,
139+
"orders.number": 6
140140
},
141141
{
142-
"orders.number": 7,
142+
"orders.number": 7
143143
},
144144
{
145-
"orders.number": 8,
145+
"orders.number": 8
146146
},
147147
{
148-
"orders.number": 9,
148+
"orders.number": 9
149149
},
150150
{
151-
"orders.number": 10,
152-
},
153-
];
151+
"orders.number": 10
152+
}
153+
]
154154
```
155155

156156
## Source code

docs/pages/product/apis-integrations/rest-api.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ configuration in the `cube.js` file, assuming that service accounts have
184184
module.exports = {
185185
contextToApiScopes: (securityContext, defaultScopes) => {
186186
if (securityContext.service) {
187-
return ["meta", ...defaultScopes];
187+
return ["meta", ...defaultScopes]
188188
}
189189

190-
return defaultScopes;
191-
},
192-
};
190+
return defaultScopes
191+
}
192+
}
193193
```
194194

195195
### CORS
@@ -205,10 +205,10 @@ following configuration in the `cube.js` file:
205205
module.exports = {
206206
http: {
207207
cors: {
208-
origin: "https://example.com",
209-
},
210-
},
211-
};
208+
origin: "https://example.com"
209+
}
210+
}
211+
}
212212
```
213213

214214
## Prerequisites

docs/pages/product/apis-integrations/rest-api/query-format.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,10 @@ const resultSet = await cubeApi.load({
623623
{
624624
dimension: "stories.time",
625625
compareDateRange: ["this week", ["2020-05-21", "2020-05-28"]],
626-
granularity: "month",
627-
},
628-
],
629-
});
626+
granularity: "month"
627+
}
628+
]
629+
})
630630
```
631631

632632
### Relative date range

docs/pages/product/apis-integrations/semantic-layer-sync.mdx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ module.exports = {
124124
user: "mail@example.com",
125125
password: "4dceae-606a03-93ae6dc7",
126126
url: "superset.example.com",
127-
database: "Cube Cloud: staging-deployment",
128-
},
129-
},
130-
];
131-
},
132-
};
127+
database: "Cube Cloud: staging-deployment"
128+
}
129+
}
130+
]
131+
}
132+
}
133133
```
134134

135135
</CodeTabs>
@@ -181,7 +181,7 @@ def semantic_layer_sync(ctx: dict) -> list[dict]:
181181
```javascript
182182
module.exports = {
183183
semanticLayerSync: ({ securityContext }) => {
184-
const department = securityContext.department;
184+
const department = securityContext.department
185185

186186
return [
187187
{
@@ -191,12 +191,12 @@ module.exports = {
191191
user: "mail@example.com",
192192
password: "4dceae-606a03-93ae6dc7",
193193
url: "example.metabaseapp.com",
194-
database: `Cube Cloud: ${department}`,
195-
},
196-
},
197-
];
198-
},
199-
};
194+
database: `Cube Cloud: ${department}`
195+
}
196+
}
197+
]
198+
}
199+
}
200200
```
201201

202202
</CodeTabs>
@@ -252,8 +252,8 @@ module.exports = {
252252
user: "mail@example.com",
253253
password: "4dceae-606a03-93ae6dc7",
254254
url: "superset.example.com",
255-
database: "Cube Cloud: sls-test (admin)",
256-
},
255+
database: "Cube Cloud: sls-test (admin)"
256+
}
257257
},
258258
{
259259
type: "preset",
@@ -262,16 +262,16 @@ module.exports = {
262262
api_token: "07988f63-c200-499e-97c9-ba137d8918aa",
263263
api_secret: "c19fbab4fd4945899795d32898f2e1165bef8e5ee653",
264264
workspace_url: "12345678.us1a.app.preset.io",
265-
database: "Cube Cloud: sls-test (admin)",
266-
},
267-
},
268-
];
265+
database: "Cube Cloud: sls-test (admin)"
266+
}
267+
}
268+
]
269269
} else {
270270
// Only sync the 'admin' data model
271-
return [];
271+
return []
272272
}
273-
},
274-
};
273+
}
274+
}
275275
```
276276

277277
</CodeTabs>

docs/pages/product/apis-integrations/semantic-layer-sync/metabase.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ module.exports = {
5353
user: "mail@example.com",
5454
password: "4dceae-606a03-93ae6dc7",
5555
url: "example.metabaseapp.com",
56-
database: "Cube Cloud: production-deployment",
57-
},
58-
},
59-
];
60-
},
61-
};
56+
database: "Cube Cloud: production-deployment"
57+
}
58+
}
59+
]
60+
}
61+
}
6262
```
6363

6464
</CodeTabs>

0 commit comments

Comments
 (0)