Skip to content

Commit 7ddd11e

Browse files
authored
Merge pull request #122 from github/joshmgross/lint
Run formatting, linting, and tests in CI
2 parents 2984f1a + 6ca7d3a commit 7ddd11e

11 files changed

Lines changed: 23 additions & 24 deletions

File tree

.eslintrc.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99
"plugin:@typescript-eslint/recommended-requiring-type-checking",
1010
"prettier"
1111
],
12+
"ignorePatterns": ["src/external"],
1213
"parser": "@typescript-eslint/parser",
1314
"parserOptions": {
1415
"project": "./tsconfig.json"
1516
},
1617
"plugins": ["@typescript-eslint", "prettier"],
1718
"reportUnusedDisableDirectives": true,
1819
"root": true,
19-
"rules": {
20-
"no-control-regex": "off",
21-
"@typescript-eslint/ban-ts-comment": "off",
22-
"@typescript-eslint/no-inferrable-types": ["warn", {"ignoreParameters": true, "ignoreProperties": true}],
23-
"@typescript-eslint/triple-slash-reference": "off"
24-
}
20+
"rules": {}
2521
}

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ jobs:
1919
- run: npm ci
2020
env:
2121
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- run: npm run format-check
23+
- run: npm run lint
2224
- name: build
23-
run: npm run build --if-present
25+
run: npm run build
2426
env:
2527
CI: true
28+
- run: npm run test

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@
510510
"open-in-browser": "vscode-test-web --extensionDevelopmentPath=. .",
511511
"lint": "eslint . --ext .ts",
512512
"lint-fix": "eslint . --ext .ts --fix",
513-
"prettier": "prettier .",
514-
"prettier-fix": "prettier --write .",
513+
"format": "prettier --write '**/*.ts'",
514+
"format-check": "prettier --check '**/*.ts'",
515515
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest",
516516
"test-watch": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --watch"
517517
},
@@ -528,7 +528,7 @@
528528
"eslint-plugin-prettier": "^4.2.1",
529529
"jest": "^29.0.3",
530530
"node-loader": "^0.6.0",
531-
"prettier": "^2.7.1",
531+
"prettier": "^2.8.3",
532532
"rimraf": "^3.0.1",
533533
"source-map-loader": "^4.0.1",
534534
"ts-jest": "^29.0.3",

src/api/api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {Octokit} from "@octokit/rest";
22
import {version} from "../../package.json";
33

4-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
54
export const userAgent = `VS Code GitHub Actions (${version})`;
65

76
export function getClient(token: string): Octokit {

src/commands/openWorkflowJobLogs.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {GitHubRepoContext} from "../git/repository";
33
import {updateDecorations} from "../logs/formatProvider";
44
import {getLogInfo} from "../logs/logInfo";
55
import {buildLogURI} from "../logs/scheme";
6-
import {WorkflowStep} from "../model";
76
import {WorkflowJob} from "../store/WorkflowJob";
87

98
export interface OpenWorkflowJobLogsCommandArgs {

src/globals.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
declare var PRODUCTION: boolean;
1+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2+
declare let PRODUCTION: boolean;

src/logs/model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line no-control-regex
12
const ansiColorRegex = /\u001b\[(\d+;?)+m/gm;
23
const groupMarker = "##[group]";
34

src/logs/parser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const URLRegex = /([{([]*https?:\/\/[a-z0-9]+(?:-[a-z0-9]+)*\.[^\s<>|'",]
1616
* (?:(?:;[0-9]{0,3})*)?: Match one or more occurances of the format we want with semicolon
1717
*/
1818

19+
// eslint-disable-next-line no-control-regex
1920
const _ansiEscapeCodeRegex = /(?:\u001b\[)(?:[?|#])?(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-Z|a-z])/;
2021

2122
/**

src/treeViews/shared/runTooltipHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dayjs.extend(relativeTime);
1010

1111
// Returns a string like "**Succeeded** in **1m 2s**"
1212
// For use in markdown tooltip
13-
export function getStatusString(item: WorkflowRun | WorkflowRunAttempt, capitalize: boolean = false): string {
13+
export function getStatusString(item: WorkflowRun | WorkflowRunAttempt, capitalize = false): string {
1414
let statusText = item.run.conclusion || item.run.status || "";
1515
switch (statusText) {
1616
case "success":
@@ -70,7 +70,7 @@ export function getEventString(item: WorkflowRun | WorkflowRunAttempt): string {
7070
}
7171

7272
if (item.run.run_started_at) {
73-
let started_at = dayjs(item.run.run_started_at);
73+
const started_at = dayjs(item.run.run_started_at);
7474
eventString += ` ${started_at.fromNow()} *(${started_at.format("LLL")})*`;
7575
}
7676

0 commit comments

Comments
 (0)