Skip to content

Commit 10946a6

Browse files
Fix errors highlighted by ts:lint
1 parent a3bf5b7 commit 10946a6

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/*global module*/
2+
13
module.exports = {
24
clearMocks: true,
35
moduleFileExtensions: ['js', 'ts'],

lib/installer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/*global exports, process, require*/
2+
13
"use strict";
24
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
35
return new (P || (P = Promise))(function (resolve, reject) {
@@ -145,7 +147,7 @@ function fetchVersions(includePreReleases, repoToken) {
145147
}
146148
}
147149
return tags
148-
.filter(tag => tag.tag_name.match(/v\d+\.[\w\.]+/g))
150+
.filter(tag => tag.tag_name.match(/v\d+\.[\w.]+/g))
149151
.filter(tag => includePrerelease(tag.prerelease, includePreReleases))
150152
.map(tag => tag.tag_name.replace("v", ""));
151153
});

lib/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/*global exports, require*/
2+
13
"use strict";
24
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
35
return new (P || (P = Promise))(function (resolve, reject) {

src/installer.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import * as tc from "@actions/tool-cache";
2727
import * as exc from "@actions/exec";
2828
import * as io from "@actions/io";
2929

30-
let osPlat: string = os.platform();
31-
let osArch: string = os.arch();
30+
const osPlat: string = os.platform();
31+
const osArch: string = os.arch();
3232

3333
interface IProtocRelease {
3434
tag_name: string;
@@ -73,7 +73,7 @@ export async function getProtoc(
7373
// Go is installed, add $GOPATH/bin to the $PATH because setup-go
7474
// doesn't do it for us.
7575
let stdOut = "";
76-
let options = {
76+
const options = {
7777
listeners: {
7878
stdout: (data: Buffer) => {
7979
stdOut += data.toString();
@@ -91,8 +91,8 @@ export async function getProtoc(
9191

9292
async function downloadRelease(version: string): Promise<string> {
9393
// Download
94-
let fileName: string = getFileName(version);
95-
let downloadUrl: string = util.format(
94+
const fileName: string = getFileName(version);
95+
const downloadUrl: string = util.format(
9696
"https://github.com/protocolbuffers/protobuf/releases/download/%s/%s",
9797
version,
9898
fileName
@@ -108,7 +108,7 @@ async function downloadRelease(version: string): Promise<string> {
108108
}
109109

110110
// Extract
111-
let extPath: string = await tc.extractZip(downloadPath);
111+
const extPath: string = await tc.extractZip(downloadPath);
112112

113113
// Install into the local tool cache - node extracts with a root folder that matches the fileName downloaded
114114
return await tc.cacheDir(extPath, "protoc", version);
@@ -151,7 +151,7 @@ async function fetchVersions(
151151

152152
let tags: IProtocRelease[] = [];
153153
for (let pageNum = 1, morePages = true; morePages; pageNum++) {
154-
let nextPage: IProtocRelease[] =
154+
const nextPage: IProtocRelease[] =
155155
(await rest.get<IProtocRelease[]>(
156156
"https://api.github.com/repos/protocolbuffers/protobuf/releases?page=" +
157157
pageNum
@@ -164,7 +164,7 @@ async function fetchVersions(
164164
}
165165

166166
return tags
167-
.filter(tag => tag.tag_name.match(/v\d+\.[\w\.]+/g))
167+
.filter(tag => tag.tag_name.match(/v\d+\.[\w.]+/g))
168168
.filter(tag => includePrerelease(tag.prerelease, includePreReleases))
169169
.map(tag => tag.tag_name.replace("v", ""));
170170
}

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import * as installer from "./installer";
33

44
async function run() {
55
try {
6-
let version = core.getInput("version");
7-
let includePreReleases = convertToBoolean(
6+
const version = core.getInput("version");
7+
const includePreReleases = convertToBoolean(
88
core.getInput("include-pre-releases")
99
);
10-
let repoToken = core.getInput("repo-token");
10+
const repoToken = core.getInput("repo-token");
1111
await installer.getProtoc(version, includePreReleases, repoToken);
1212
} catch (error) {
1313
core.setFailed(error.message);

0 commit comments

Comments
 (0)