Skip to content

Commit f1a66c7

Browse files
bump prettier to 2.8.4
1 parent 82a5eab commit f1a66c7

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

__tests__/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("filename tests", () => {
2424
["protoc-3.20.2-osx-aarch_64.zip", "darwin", "arm64"],
2525
["protoc-3.20.2-osx-x86_64.zip", "darwin", "x64"],
2626
["protoc-3.20.2-win64.zip", "win32", "x64"],
27-
["protoc-3.20.2-win32.zip", "win32", "x32"]
27+
["protoc-3.20.2-win32.zip", "win32", "x32"],
2828
];
2929
for (const [expected, plat, arch] of tests) {
3030
it(`downloads ${expected} correctly`, () => {
@@ -35,7 +35,7 @@ describe("filename tests", () => {
3535
});
3636

3737
describe("installer tests", () => {
38-
beforeEach(async function() {
38+
beforeEach(async function () {
3939
await io.rmRF(toolDir);
4040
await io.rmRF(tempDir);
4141
await io.mkdirP(toolDir);

package-lock.json

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"markdown-link-check": "^3.10.2",
4848
"markdownlint-cli": "^0.32.2",
4949
"nock": "^10.0.6",
50-
"prettier": "^1.17.1",
50+
"prettier": "^2.8.4",
5151
"ts-jest": "^24.0.2",
5252
"typescript": "^4.9.5"
5353
}

src/installer.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export async function getProtoc(
7777
listeners: {
7878
stdout: (data: Buffer) => {
7979
stdOut += data.toString();
80-
}
81-
}
80+
},
81+
},
8282
};
8383

8484
await exc.exec("go", ["env", "GOPATH"], options);
@@ -187,7 +187,7 @@ async function fetchVersions(
187187
let rest: restm.RestClient;
188188
if (repoToken != "") {
189189
rest = new restm.RestClient("setup-protoc", "", [], {
190-
headers: { Authorization: "Bearer " + repoToken }
190+
headers: { Authorization: "Bearer " + repoToken },
191191
});
192192
} else {
193193
rest = new restm.RestClient("setup-protoc");
@@ -208,9 +208,9 @@ async function fetchVersions(
208208
}
209209

210210
return tags
211-
.filter(tag => tag.tag_name.match(/v\d+\.[\w\.]+/g))
212-
.filter(tag => includePrerelease(tag.prerelease, includePreReleases))
213-
.map(tag => tag.tag_name.replace("v", ""));
211+
.filter((tag) => tag.tag_name.match(/v\d+\.[\w\.]+/g))
212+
.filter((tag) => includePrerelease(tag.prerelease, includePreReleases))
213+
.map((tag) => tag.tag_name.replace("v", ""));
214214
}
215215

216216
// Compute an actual version starting from the `version` configuration param.
@@ -230,15 +230,15 @@ async function computeVersion(
230230
}
231231

232232
const allVersions = await fetchVersions(includePreReleases, repoToken);
233-
const validVersions = allVersions.filter(v => semver.valid(v));
234-
const possibleVersions = validVersions.filter(v => v.startsWith(version));
233+
const validVersions = allVersions.filter((v) => semver.valid(v));
234+
const possibleVersions = validVersions.filter((v) => v.startsWith(version));
235235

236236
const versionMap = new Map();
237-
possibleVersions.forEach(v => versionMap.set(normalizeVersion(v), v));
237+
possibleVersions.forEach((v) => versionMap.set(normalizeVersion(v), v));
238238

239239
const versions = Array.from(versionMap.keys())
240240
.sort(semver.rcompare)
241-
.map(v => versionMap.get(v));
241+
.map((v) => versionMap.get(v));
242242

243243
core.debug(`evaluating ${versions.length} versions`);
244244

@@ -264,7 +264,7 @@ function normalizeVersion(version: string): string {
264264
} else {
265265
// handle beta and rc
266266
// e.g. 1.10beta1 -? 1.10.0-beta1, 1.10rc1 -> 1.10.0-rc1
267-
if (preStrings.some(el => versionPart[1].includes(el))) {
267+
if (preStrings.some((el) => versionPart[1].includes(el))) {
268268
versionPart[1] = versionPart[1]
269269
.replace("beta", ".0-beta")
270270
.replace("rc", ".0-rc")
@@ -280,7 +280,7 @@ function normalizeVersion(version: string): string {
280280
} else {
281281
// handle beta and rc
282282
// e.g. 1.8.5beta1 -> 1.8.5-beta1, 1.8.5rc1 -> 1.8.5-rc1
283-
if (preStrings.some(el => versionPart[2].includes(el))) {
283+
if (preStrings.some((el) => versionPart[2].includes(el))) {
284284
versionPart[2] = versionPart[2]
285285
.replace("beta", "-beta")
286286
.replace("rc", "-rc")

0 commit comments

Comments
 (0)