Skip to content

Commit 49f8f61

Browse files
authored
chore: use gts (GoogleCloudPlatform#2025)
1 parent 92fce56 commit 49f8f61

File tree

194 files changed

+1320
-1238
lines changed

Some content is hidden

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

194 files changed

+1320
-1238
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ test/fixtures
44
build/
55
docs/
66
protos/
7+
run/idp-sql/

.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.eslintrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "./node_modules/gts/",
3+
"env": {
4+
"mocha": true
5+
},
6+
"rules": {
7+
"node/no-missing-require": ["off"],
8+
"node/no-unpublished-require": ["off"],
9+
"no-unused-vars": ["off"],
10+
"node/no-deprecated-api": ["off"],
11+
"no-process-exit": ["off"]
12+
}
13+
}

.estlintrc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

appengine/analytics/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ const trackEvent = (category, action, label, value) => {
4646
ev: value,
4747
};
4848

49-
return axios.get('http://www.google-analytics.com/debug/collect', { params: data });
49+
return axios.get('http://www.google-analytics.com/debug/collect', {
50+
params: data,
51+
});
5052
};
5153

5254
app.get('/', async (req, res, next) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// [START app]
1818
const express = require('express');
1919
const bodyParser = require('body-parser');
20-
const path = require(`path`);
20+
const path = require('path');
2121

2222
const app = express();
2323

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const cwd = path.join(__dirname, '../');
2424
const requestObj = supertest(proxyquire(path.join(cwd, 'server'), {process}));
2525

2626
const stubConsole = function () {
27-
sinon.stub(console, `error`);
28-
sinon.stub(console, `log`);
27+
sinon.stub(console, 'error');
28+
sinon.stub(console, 'log');
2929
};
3030

3131
const restoreConsole = function () {
@@ -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
});
@@ -50,9 +50,11 @@ describe('add_display_form', () => {
5050
await requestObj
5151
.get('/submit')
5252
.expect(200)
53-
.expect((response) => {
53+
.expect(response => {
5454
assert.strictEqual(
55-
response.text.includes('textarea name="message" placeholder="Message"'),
55+
response.text.includes(
56+
'textarea name="message" placeholder="Message"'
57+
),
5658
true
5759
);
5860
});
@@ -67,7 +69,7 @@ describe('add_post_handler enable_parser', () => {
6769
message: 'sample-message',
6870
})
6971
.expect(200)
70-
.expect((response) => {
72+
.expect(response => {
7173
assert.strictEqual(response.text, 'Thanks for your message!');
7274
});
7375
});

appengine/cloudsql/createTables.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ 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');
4141
});
4242

43-
console.log(`Successfully created 'visits' table.`);
43+
console.log("Successfully created 'visits' table.");
4444
} catch (err) {
45-
console.error(`Failed to create 'visits' table:`, err);
45+
console.error("Failed to create 'visits' table:", err);
4646
} finally {
4747
if (knex) {
4848
knex.destroy();

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ const getSample = () => {
5858

5959
const stubConsole = function () {
6060
/* eslint-disable no-console */
61-
sinon.stub(console, `error`);
62-
sinon.stub(console, `log`);
61+
sinon.stub(console, 'error');
62+
sinon.stub(console, 'log');
6363
};
6464

6565
const restoreConsole = function () {
@@ -73,7 +73,7 @@ afterEach(restoreConsole);
7373
describe('gae_flex_mysql_create_tables', () => {
7474
it('should create a table', async () => {
7575
const sample = getSample();
76-
const expectedResult = `Successfully created 'visits' table.`;
76+
const expectedResult = "Successfully created 'visits' table.";
7777

7878
proxyquire(SAMPLE_PATH, {
7979
knex: sample.mocks.Knex,
@@ -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,10 +133,10 @@ 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(
139-
console.error.calledWith(`Failed to create 'visits' table:`, error)
139+
console.error.calledWith("Failed to create 'visits' table:", error)
140140
);
141141
assert.ok(sample.mocks.knex.destroy.calledOnce);
142142
});

0 commit comments

Comments
 (0)