Skip to content

Commit f85b0ae

Browse files
authored
chore(deps): update dependency prettier to v2 (#1631)
* chore(deps): update dependency prettier to v2 * Update format * Update node version in lint test
1 parent fcee0e8 commit f85b0ae

118 files changed

Lines changed: 368 additions & 459 deletions

File tree

Some content is hidden

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

.kokoro/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh"
1212
# Configure the docker image for kokoro-trampoline.
1313
env_vars: {
1414
key: "TRAMPOLINE_IMAGE"
15-
value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user"
15+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
1616
}
1717

1818
# Export XUnit test results for further analysis

appengine/analytics/app.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ app.get('/', async (req, res, next) => {
5858
'Example label',
5959
'100'
6060
);
61-
res
62-
.status(200)
63-
.send('Event tracked.')
64-
.end();
61+
res.status(200).send('Event tracked.').end();
6562
} catch (error) {
6663
// This sample treats an event tracking error as a fatal error. Depending
6764
// on your application's needs, failing to track an event may not be

appengine/building-an-app/update/test/server.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ const cwd = path.join(__dirname, '../');
2323

2424
const requestObj = supertest(proxyquire(path.join(cwd, 'server'), {process}));
2525

26-
const stubConsole = function() {
26+
const stubConsole = function () {
2727
sinon.stub(console, `error`);
2828
sinon.stub(console, `log`);
2929
};
3030

31-
const restoreConsole = function() {
31+
const restoreConsole = function () {
3232
console.log.restore();
3333
console.error.restore();
3434
};
@@ -40,7 +40,7 @@ it('should send greetings', async () => {
4040
await requestObj
4141
.get('/')
4242
.expect(200)
43-
.expect(response => {
43+
.expect((response) => {
4444
assert.strictEqual(response.text, 'Hello from App Engine!');
4545
});
4646
});
@@ -49,7 +49,7 @@ it('should display form', async () => {
4949
await requestObj
5050
.get('/submit')
5151
.expect(200)
52-
.expect(response => {
52+
.expect((response) => {
5353
assert.strictEqual(
5454
response.text.includes('textarea name="message" placeholder="Message"'),
5555
true
@@ -64,7 +64,7 @@ it('should record message', async () => {
6464
message: 'sample-message',
6565
})
6666
.expect(200)
67-
.expect(response => {
67+
.expect((response) => {
6868
assert.strictEqual(response.text, 'Thanks for your message!');
6969
});
7070
});

appengine/cloudsql/createTables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ prompt.get(FIELDS, async (err, config) => {
3434

3535
// Create the "visits" table
3636
try {
37-
await knex.schema.createTable('visits', table => {
37+
await knex.schema.createTable('visits', (table) => {
3838
table.increments();
3939
table.timestamp('timestamp');
4040
table.string('userIp');

appengine/cloudsql/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ const insertVisit = (knex, visit) => {
6969
* @param {object} knex The Knex connection object.
7070
* @returns {Promise}
7171
*/
72-
const getVisits = async knex => {
72+
const getVisits = async (knex) => {
7373
const results = await knex
7474
.select('timestamp', 'userIp')
7575
.from('visits')
7676
.orderBy('timestamp', 'desc')
7777
.limit(10);
7878

7979
return results.map(
80-
visit => `Time: ${visit.timestamp}, AddrHash: ${visit.userIp}`
80+
(visit) => `Time: ${visit.timestamp}, AddrHash: ${visit.userIp}`
8181
);
8282
};
8383

appengine/cloudsql/test/createTables.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ const getSample = () => {
5656
};
5757
};
5858

59-
const stubConsole = function() {
59+
const stubConsole = function () {
6060
/* eslint-disable no-console */
6161
sinon.stub(console, `error`);
6262
sinon.stub(console, `log`);
6363
};
6464

65-
const restoreConsole = function() {
65+
const restoreConsole = function () {
6666
console.log.restore();
6767
console.error.restore();
6868
};
@@ -87,7 +87,7 @@ describe('gae_flex_mysql_create_tables', () => {
8787
exampleConfig
8888
);
8989

90-
await new Promise(r => setTimeout(r, 10));
90+
await new Promise((r) => setTimeout(r, 10));
9191
assert.ok(sample.mocks.Knex.calledOnce);
9292
assert.deepStrictEqual(sample.mocks.Knex.firstCall.args, [
9393
{
@@ -116,7 +116,7 @@ describe('gae_flex_mysql_create_tables', () => {
116116
prompt: sample.mocks.prompt,
117117
});
118118

119-
await new Promise(r => setTimeout(r, 10));
119+
await new Promise((r) => setTimeout(r, 10));
120120
assert.ok(console.error.calledOnce);
121121
assert.ok(console.error.calledWith(error));
122122
assert.ok(sample.mocks.Knex.notCalled);
@@ -133,7 +133,7 @@ describe('gae_flex_mysql_create_tables', () => {
133133
knex: sample.mocks.Knex,
134134
prompt: sample.mocks.prompt,
135135
});
136-
await new Promise(r => setTimeout(r, 10));
136+
await new Promise((r) => setTimeout(r, 10));
137137
assert.ok(console.error.calledOnce);
138138
assert.ok(
139139
console.error.calledWith(`Failed to create 'visits' table:`, error)

appengine/cloudsql/test/server.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('gae_flex_mysql_app', () => {
9999
await request(sample.app)
100100
.get('/')
101101
.expect(200)
102-
.expect(response => {
102+
.expect((response) => {
103103
assert.strictEqual(response.text, expectedResult);
104104
});
105105
});
@@ -113,7 +113,7 @@ describe('gae_flex_mysql_app', () => {
113113
await request(sample.app)
114114
.get('/')
115115
.expect(500)
116-
.expect(response => {
116+
.expect((response) => {
117117
assert.ok(response.text.includes(expectedResult));
118118
});
119119
});
@@ -127,7 +127,7 @@ describe('gae_flex_mysql_app', () => {
127127
await request(sample.app)
128128
.get('/')
129129
.expect(500)
130-
.expect(response => {
130+
.expect((response) => {
131131
assert.ok(response.text.includes(expectedResult));
132132
});
133133
});

appengine/cloudsql_postgresql/createTables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ prompt.get(FIELDS, async (err, config) => {
3434

3535
// Create the "visits" table
3636
try {
37-
await knex.schema.createTable('visits', table => {
37+
await knex.schema.createTable('visits', (table) => {
3838
table.increments();
3939
table.timestamp('timestamp');
4040
table.string('userIp');

appengine/cloudsql_postgresql/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ const insertVisit = (knex, visit) => {
7070
* @returns {Promise}
7171
*/
7272

73-
const getVisits = async knex => {
73+
const getVisits = async (knex) => {
7474
const results = await knex
7575
.select('timestamp', 'userIp')
7676
.from('visits')
7777
.orderBy('timestamp', 'desc')
7878
.limit(10);
7979

8080
return results.map(
81-
visit => `Time: ${visit.timestamp}, AddrHash: ${visit.userIp}`
81+
(visit) => `Time: ${visit.timestamp}, AddrHash: ${visit.userIp}`
8282
);
8383
};
8484

appengine/cloudsql_postgresql/test/createTables.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ const getSample = () => {
5656
};
5757
};
5858

59-
const stubConsole = function() {
59+
const stubConsole = function () {
6060
sinon.stub(console, `error`);
6161
sinon.stub(console, `log`);
6262
};
6363

64-
const restoreConsole = function() {
64+
const restoreConsole = function () {
6565
console.log.restore();
6666
console.error.restore();
6767
};
@@ -86,7 +86,7 @@ describe('gae_flex_postgres_create_tables', () => {
8686
exampleConfig
8787
);
8888

89-
await new Promise(r => setTimeout(r, 10));
89+
await new Promise((r) => setTimeout(r, 10));
9090
assert.ok(sample.mocks.Knex.calledOnce);
9191
assert.deepStrictEqual(sample.mocks.Knex.firstCall.args, [
9292
{
@@ -115,7 +115,7 @@ describe('gae_flex_postgres_create_tables', () => {
115115
prompt: sample.mocks.prompt,
116116
});
117117

118-
await new Promise(r => setTimeout(r, 10));
118+
await new Promise((r) => setTimeout(r, 10));
119119
assert.ok(console.error.calledOnce);
120120
assert.ok(console.error.calledWith(error));
121121
assert.ok(sample.mocks.Knex.notCalled);
@@ -133,7 +133,7 @@ describe('gae_flex_postgres_create_tables', () => {
133133
prompt: sample.mocks.prompt,
134134
});
135135

136-
await new Promise(r => setTimeout(r, 10));
136+
await new Promise((r) => setTimeout(r, 10));
137137
assert.ok(console.error.calledOnce);
138138
assert.ok(
139139
console.error.calledWith(`Failed to create 'visits' table:`, error)

0 commit comments

Comments
 (0)