Skip to content

Commit 2dc7216

Browse files
authored
upgrade prettier (#3010)
* upgrade prettier * prettier formatting
1 parent bc35efa commit 2dc7216

File tree

141 files changed

+1026
-1436
lines changed

Some content is hidden

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

141 files changed

+1026
-1436
lines changed

Diff for: .prettierrc

-5
This file was deleted.

Diff for: .prettierrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
printWidth: 100,
3+
};

Diff for: package-lock.json

+10-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@
180180
"coveralls": "^3.1.0",
181181
"eslint": "^7.17.0",
182182
"eslint-config-google": "^0.14.0",
183-
"eslint-config-prettier": "^6.10.0",
183+
"eslint-config-prettier": "^7.1.0",
184184
"eslint-plugin-jsdoc": "^30.7.13",
185-
"eslint-plugin-prettier": "^3.1.0",
185+
"eslint-plugin-prettier": "^3.3.1",
186186
"exegesis": "^2.5.6",
187187
"firebase": "^7.24.0",
188188
"firebase-admin": "^9.4.2",
@@ -192,7 +192,7 @@
192192
"nock": "^13.0.5",
193193
"nyc": "^15.1.0",
194194
"openapi-merge": "^1.0.23",
195-
"prettier": "^1.19.0",
195+
"prettier": "^2.2.1",
196196
"proxy": "^1.0.2",
197197
"sinon": "^6.3.4",
198198
"sinon-chai": "^3.2.0",

Diff for: scripts/assets/functions_to_test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ var functions = require("firebase-functions");
22
var admin = require("firebase-admin");
33
admin.initializeApp(functions.config().firebase);
44

5-
exports.dbAction = functions.database.ref("/input/{uuid}").onCreate(function(snap, context) {
5+
exports.dbAction = functions.database.ref("/input/{uuid}").onCreate(function (snap, context) {
66
console.log("Received snapshot:", snap);
77
return snap.ref.root.child("output/" + context.params.uuid).set(snap.val());
88
});
99

1010
exports.nested = {
11-
dbAction: functions.database.ref("/inputNested/{uuid}").onCreate(function(snap, context) {
11+
dbAction: functions.database.ref("/inputNested/{uuid}").onCreate(function (snap, context) {
1212
console.log("Received snap:", snap);
1313
return snap.ref.root.child("output/" + context.params.uuid).set(snap.val());
1414
}),
1515
};
1616

17-
exports.httpsAction = functions.https.onRequest(function(req, res) {
17+
exports.httpsAction = functions.https.onRequest(function (req, res) {
1818
res.send(req.body);
1919
});
2020

21-
exports.pubsubAction = functions.pubsub.topic("topic1").onPublish(function(message) {
21+
exports.pubsubAction = functions.pubsub.topic("topic1").onPublish(function (message) {
2222
console.log("Received message:", message);
2323
var uuid = message.json;
2424
return admin
@@ -27,7 +27,7 @@ exports.pubsubAction = functions.pubsub.topic("topic1").onPublish(function(messa
2727
.set(uuid);
2828
});
2929

30-
exports.gcsAction = functions.storage.object().onFinalize(function(object) {
30+
exports.gcsAction = functions.storage.object().onFinalize(function (object) {
3131
console.log("Received object:", object);
3232
var uuid = object.name;
3333
return admin
@@ -38,7 +38,7 @@ exports.gcsAction = functions.storage.object().onFinalize(function(object) {
3838

3939
exports.pubsubScheduleAction = functions.pubsub
4040
.schedule("every 10 minutes")
41-
.onRun(function(context) {
41+
.onRun(function (context) {
4242
console.log("Scheduled function triggered:", context);
4343
return true;
4444
});

Diff for: scripts/extensions-emulator-tests/tests.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function readConfig(): FrameworkOptions {
2828
describe("extension emulator", () => {
2929
let test: TriggerEndToEndTest;
3030

31-
before(async function(this) {
31+
before(async function (this) {
3232
this.timeout(TEST_SETUP_TIMEOUT);
3333

3434
expect(FIREBASE_PROJECT).to.exist.and.not.be.empty;
@@ -46,12 +46,12 @@ describe("extension emulator", () => {
4646
]);
4747
});
4848

49-
after(async function(this) {
49+
after(async function (this) {
5050
this.timeout(EMULATORS_SHUTDOWN_DELAY_MS);
5151
await test.stopEmulators();
5252
});
5353

54-
it("should execute an HTTP function", async function(this) {
54+
it("should execute an HTTP function", async function (this) {
5555
this.timeout(EMULATORS_SHUTDOWN_DELAY_MS);
5656

5757
const res = await test.invokeHttpFunction(TEST_FUNCTION_NAME, FIREBASE_PROJECT_ZONE);

Diff for: scripts/firepit-builder/pipeline.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ mv("../../node_modules", ".");
6464

6565
echo("-- Removing native platform addons (.node)");
6666
find(".")
67-
.filter(function(file) {
67+
.filter(function (file) {
6868
return file.match(/\.node$/);
6969
})
7070
.forEach((file) => {

Diff for: scripts/test-functions-config.js

+31-30
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var localFirebase = __dirname + "/../lib/bin/firebase.js";
2525
var projectDir = __dirname + "/test-project";
2626
var tmpDir;
2727

28-
var preTest = function() {
28+
var preTest = function () {
2929
var dir = tmp.dirSync({ prefix: "cfgtest_" });
3030
tmpDir = dir.name;
3131
fs.copySync(projectDir, tmpDir);
@@ -35,101 +35,102 @@ var preTest = function() {
3535
console.log("Done pretest prep.");
3636
};
3737

38-
var postTest = function() {
38+
var postTest = function () {
3939
fs.remove(tmpDir);
4040
console.log("Done post-test cleanup.");
4141
};
4242

43-
var set = function(expression) {
44-
return new Promise(function(resolve) {
43+
var set = function (expression) {
44+
return new Promise(function (resolve) {
4545
exec(
4646
`${localFirebase} functions:config:set ${expression} --project=${projectId}`,
4747
{ cwd: tmpDir },
48-
function(err) {
48+
function (err) {
4949
expect(err).to.be.null;
5050
resolve();
5151
}
5252
);
5353
});
5454
};
5555

56-
var unset = function(key) {
57-
return new Promise(function(resolve) {
56+
var unset = function (key) {
57+
return new Promise(function (resolve) {
5858
exec(
5959
`${localFirebase} functions:config:unset ${key} --project=${projectId}`,
6060
{ cwd: tmpDir },
61-
function(err) {
61+
function (err) {
6262
expect(err).to.be.null;
6363
resolve();
6464
}
6565
);
6666
});
6767
};
6868

69-
var getAndCompare = function(expected) {
70-
return new Promise(function(resolve) {
71-
exec(`${localFirebase} functions:config:get --project=${projectId}`, { cwd: tmpDir }, function(
72-
err,
73-
stdout
74-
) {
75-
expect(JSON.parse(stdout)).to.deep.equal(expected);
76-
resolve();
77-
});
69+
var getAndCompare = function (expected) {
70+
return new Promise(function (resolve) {
71+
exec(
72+
`${localFirebase} functions:config:get --project=${projectId}`,
73+
{ cwd: tmpDir },
74+
function (err, stdout) {
75+
expect(JSON.parse(stdout)).to.deep.equal(expected);
76+
resolve();
77+
}
78+
);
7879
});
7980
};
8081

81-
var runTest = function(description, expression, key, expected) {
82+
var runTest = function (description, expression, key, expected) {
8283
return set(expression)
83-
.then(function() {
84+
.then(function () {
8485
return getAndCompare(expected);
8586
})
86-
.then(function() {
87+
.then(function () {
8788
return unset(key);
8889
})
89-
.then(function() {
90+
.then(function () {
9091
console.log(clc.green("\u2713 Test passed: ") + description);
9192
});
9293
};
9394

94-
var main = function() {
95+
var main = function () {
9596
preTest();
9697
runTest("string value", "foo.bar=faz", "foo", { foo: { bar: "faz" } })
97-
.then(function() {
98+
.then(function () {
9899
return runTest("string value in quotes", 'foo.bar="faz"', "foo", {
99100
foo: { bar: "faz" },
100101
});
101102
})
102-
.then(function() {
103+
.then(function () {
103104
return runTest("string value with quotes", "foo.bar='\"faz\"'", "foo", {
104105
foo: { bar: '"faz"' },
105106
});
106107
})
107-
.then(function() {
108+
.then(function () {
108109
return runTest("single-part key and JSON value", 'foo=\'{"bar":"faz"}\'', "foo", {
109110
foo: { bar: "faz" },
110111
});
111112
})
112-
.then(function() {
113+
.then(function () {
113114
return runTest("multi-part key and JSON value", 'foo.too=\'{"bar":"faz"}\'', "foo", {
114115
foo: { too: { bar: "faz" } },
115116
});
116117
})
117-
.then(function() {
118+
.then(function () {
118119
return runTest("numeric value", "foo.bar=123", "foo", {
119120
foo: { bar: "123" },
120121
});
121122
})
122-
.then(function() {
123+
.then(function () {
123124
return runTest("numeric value in quotes", 'foo.bar="123"', "foo", {
124125
foo: { bar: "123" },
125126
});
126127
})
127-
.then(function() {
128+
.then(function () {
128129
return runTest("null value", "foo.bar=null", "foo", {
129130
foo: { bar: "null" },
130131
});
131132
})
132-
.catch(function(err) {
133+
.catch(function (err) {
133134
console.log(clc.red("Error while running tests: "), err);
134135
return Promise.resolve();
135136
})

0 commit comments

Comments
 (0)