Skip to content

Commit 83cfb62

Browse files
committed
Linting
1 parent 085ce76 commit 83cfb62

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

src/git/file.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import { relative } from "node:path";
55
import { Logger } from "../util/logger.js";
66
import { blameProcess, getRevsFile } from "./util/git-command.js";
77
import {
8+
type CommitRegistry,
89
type LineAttachedCommit,
9-
CommitRegistry,
1010
processChunk,
1111
} from "./util/stream-parsing.js";
12-
import { Duplex, PassThrough } from "node:stream";
1312

1413
export type Blame = Map<number, LineAttachedCommit | undefined>;
1514

@@ -31,9 +30,7 @@ export class File {
3130
this.killed = true;
3231
}
3332

34-
private async *run(
35-
realFileName: string,
36-
): AsyncGenerator<LineAttachedCommit> {
33+
private async *run(realFileName: string): AsyncGenerator<LineAttachedCommit> {
3734
this.process = blameProcess(realFileName, await getRevsFile(realFileName));
3835

3936
for await (const chunk of this.process?.stdout ?? []) {

src/git/util/git-command.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import { dirname, join } from "node:path";
55
import { extensions } from "vscode";
66

77
import type { GitExtension } from "../../../types/git.js";
8-
import { validEditor } from "../../util/valid-editor.js";
98
import { execute } from "../../util/execute.js";
109
import { getActiveTextEditor } from "../../util/get-active.js";
1110
import { Logger } from "../../util/logger.js";
1211
import { getProperty } from "../../util/property.js";
1312
import { split } from "../../util/split.js";
14-
import { Stream } from "node:stream";
13+
import { validEditor } from "../../util/valid-editor.js";
1514

1615
export const getGitCommand = (): string => {
1716
const vscodeGit = extensions.getExtension<GitExtension>("vscode.git");
@@ -114,11 +113,10 @@ export const getRevsFile = async (
114113
.map((path) => access(path).then(() => path)),
115114
);
116115

117-
return revsFiles
118-
.filter(
119-
(promise): promise is PromiseFulfilledResult<string> =>
120-
promise.status === "fulfilled",
121-
)[0]?.value
116+
return revsFiles.filter(
117+
(promise): promise is PromiseFulfilledResult<string> =>
118+
promise.status === "fulfilled",
119+
)[0]?.value;
122120
};
123121

124122
export const getRelativePathOfActiveFile = async (): Promise<string> => {

src/git/util/stream-parsing.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ const newCommitInfo = (hash: string): Commit => ({
5151
summary: "",
5252
});
5353

54-
const newLocationAttachedCommit = (
55-
commitInfo: Commit,
56-
): FileAttachedCommit => ({
54+
const newLocationAttachedCommit = (commitInfo: Commit): FileAttachedCommit => ({
5755
commit: commitInfo,
5856
filename: "",
5957
});

src/util/valid-editor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import type {
44
TextEditor,
55
} from "vscode";
66

7-
export type Document = Pick<TextDocument, "uri" | "isUntitled" | "fileName" | "lineCount">;
7+
export type Document = Pick<
8+
TextDocument,
9+
"uri" | "isUntitled" | "fileName" | "lineCount"
10+
>;
811
export type Position = Pick<FullPosition, "line">;
912
export type PartialSelection = {
1013
active: Position;

src/view.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ import {
1313
import type { Commit } from "./git/util/stream-parsing.js";
1414

1515
import { isUncommitted } from "./git/util/is-hash.js";
16-
import { type PartialTextEditor, validEditor } from "./util/valid-editor.js";
1716
import { getActiveTextEditor } from "./util/get-active.js";
1817
import { getProperty } from "./util/property.js";
19-
import { toInlineTextView, toStatusBarTextView } from "./util/text-decorator.js";
18+
import {
19+
toInlineTextView,
20+
toStatusBarTextView,
21+
} from "./util/text-decorator.js";
22+
import { type PartialTextEditor, validEditor } from "./util/valid-editor.js";
2023

2124
const MESSAGE_NO_INFO = "No info about the current line";
2225

@@ -55,7 +58,11 @@ export class StatusBarView {
5558
if (!commit) {
5659
this.clear();
5760
} else if (isUncommitted(commit)) {
58-
this.text(getProperty("statusBarMessageNoCommit"), false, MESSAGE_NO_INFO);
61+
this.text(
62+
getProperty("statusBarMessageNoCommit"),
63+
false,
64+
MESSAGE_NO_INFO,
65+
);
5966
if (editor) {
6067
void this.createLineDecoration(
6168
getProperty("inlineMessageNoCommit"),

0 commit comments

Comments
 (0)