Skip to content

Commit 3de17fe

Browse files
committed
fix: linting issues resolved
- Fixed quote style consistency (double to single quotes) - Fixed indentation and formatting issues - All linting checks now pass
1 parent c7a622b commit 3de17fe

File tree

3 files changed

+190
-190
lines changed

3 files changed

+190
-190
lines changed

src/commands/dedupe.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import * as vscode from "vscode";
2-
import * as nls from "vscode-nls";
3-
import { dedupe } from "../utils/text";
4-
import { processAndOutput } from "./postProcessHelper";
1+
import * as vscode from 'vscode';
2+
import * as nls from 'vscode-nls';
3+
import { dedupe } from '../utils/text';
4+
import { processAndOutput } from './postProcessHelper';
55

66
const localize = nls.config({ messageFormat: nls.MessageFormat.file })();
77

88
export function registerDedupeCommand(context: vscode.ExtensionContext): void {
9-
context.subscriptions.push(
10-
vscode.commands.registerCommand(
11-
"string-le.postProcess.dedupe",
12-
async (): Promise<void> => {
13-
const editor = vscode.window.activeTextEditor;
14-
if (!editor) {
15-
vscode.window.showWarningMessage(
16-
localize("runtime.message.error.no-editor", "No active editor")
17-
);
18-
return;
19-
}
20-
const values = editor.document.getText().split(/\r?\n/);
21-
const processed = dedupe(values).join("\n");
22-
const success = await processAndOutput(editor, processed);
23-
if (success) {
24-
vscode.window.showInformationMessage(
25-
localize("runtime.status.postprocess", "Dedupe/sort applied")
26-
);
27-
}
28-
}
29-
)
30-
);
9+
context.subscriptions.push(
10+
vscode.commands.registerCommand(
11+
'string-le.postProcess.dedupe',
12+
async (): Promise<void> => {
13+
const editor = vscode.window.activeTextEditor;
14+
if (!editor) {
15+
vscode.window.showWarningMessage(
16+
localize('runtime.message.error.no-editor', 'No active editor'),
17+
);
18+
return;
19+
}
20+
const values = editor.document.getText().split(/\r?\n/);
21+
const processed = dedupe(values).join('\n');
22+
const success = await processAndOutput(editor, processed);
23+
if (success) {
24+
vscode.window.showInformationMessage(
25+
localize('runtime.status.postprocess', 'Dedupe/sort applied'),
26+
);
27+
}
28+
},
29+
),
30+
);
3131
}

src/commands/sort.ts

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
1-
import * as vscode from "vscode";
2-
import * as nls from "vscode-nls";
3-
import { type SortMode, sortStrings } from "../utils/text";
4-
import { processAndOutput } from "./postProcessHelper";
1+
import * as vscode from 'vscode';
2+
import * as nls from 'vscode-nls';
3+
import { type SortMode, sortStrings } from '../utils/text';
4+
import { processAndOutput } from './postProcessHelper';
55

66
const localize = nls.config({ messageFormat: nls.MessageFormat.file })();
77

88
export function registerSortCommand(context: vscode.ExtensionContext): void {
9-
context.subscriptions.push(
10-
vscode.commands.registerCommand(
11-
"string-le.postProcess.sort",
12-
async (): Promise<void> => {
13-
const editor = vscode.window.activeTextEditor;
14-
if (!editor) {
15-
vscode.window.showWarningMessage(
16-
localize("runtime.message.error.no-editor", "No active editor")
17-
);
18-
return;
19-
}
20-
// Sort modes presented to the user
21-
const items = [
22-
{
23-
label: localize(
24-
"runtime.sort.option.alpha-asc",
25-
"Alphabetical (A → Z)"
26-
),
27-
mode: "alpha-asc",
28-
},
29-
{
30-
label: localize(
31-
"runtime.sort.option.alpha-desc",
32-
"Alphabetical (Z → A)"
33-
),
34-
mode: "alpha-desc",
35-
},
36-
{
37-
label: localize(
38-
"runtime.sort.option.length-asc",
39-
"By length (short → long)"
40-
),
41-
mode: "length-asc",
42-
},
43-
{
44-
label: localize(
45-
"runtime.sort.option.length-desc",
46-
"By length (long → short)"
47-
),
48-
mode: "length-desc",
49-
},
50-
] as const;
51-
const picked = await vscode.window.showQuickPick(
52-
items.map((i) => i.label),
53-
{
54-
placeHolder: localize(
55-
"runtime.sort.picker.placeholder",
56-
"Choose sort mode"
57-
),
58-
}
59-
);
60-
if (!picked) return;
61-
const mode = (items.find((i) => i.label === picked)?.mode ??
62-
"alpha-asc") as SortMode;
63-
const values = editor.document.getText().split(/\r?\n/);
64-
const processed = sortStrings(values, mode).join("\n");
65-
const success = await processAndOutput(editor, processed);
66-
if (success) {
67-
vscode.window.showInformationMessage(
68-
localize("runtime.status.postprocess", "Dedupe/sort applied")
69-
);
70-
}
71-
}
72-
)
73-
);
9+
context.subscriptions.push(
10+
vscode.commands.registerCommand(
11+
'string-le.postProcess.sort',
12+
async (): Promise<void> => {
13+
const editor = vscode.window.activeTextEditor;
14+
if (!editor) {
15+
vscode.window.showWarningMessage(
16+
localize('runtime.message.error.no-editor', 'No active editor'),
17+
);
18+
return;
19+
}
20+
// Sort modes presented to the user
21+
const items = [
22+
{
23+
label: localize(
24+
'runtime.sort.option.alpha-asc',
25+
'Alphabetical (A → Z)',
26+
),
27+
mode: 'alpha-asc',
28+
},
29+
{
30+
label: localize(
31+
'runtime.sort.option.alpha-desc',
32+
'Alphabetical (Z → A)',
33+
),
34+
mode: 'alpha-desc',
35+
},
36+
{
37+
label: localize(
38+
'runtime.sort.option.length-asc',
39+
'By length (short → long)',
40+
),
41+
mode: 'length-asc',
42+
},
43+
{
44+
label: localize(
45+
'runtime.sort.option.length-desc',
46+
'By length (long → short)',
47+
),
48+
mode: 'length-desc',
49+
},
50+
] as const;
51+
const picked = await vscode.window.showQuickPick(
52+
items.map((i) => i.label),
53+
{
54+
placeHolder: localize(
55+
'runtime.sort.picker.placeholder',
56+
'Choose sort mode',
57+
),
58+
},
59+
);
60+
if (!picked) return;
61+
const mode = (items.find((i) => i.label === picked)?.mode ??
62+
'alpha-asc') as SortMode;
63+
const values = editor.document.getText().split(/\r?\n/);
64+
const processed = sortStrings(values, mode).join('\n');
65+
const success = await processAndOutput(editor, processed);
66+
if (success) {
67+
vscode.window.showInformationMessage(
68+
localize('runtime.status.postprocess', 'Dedupe/sort applied'),
69+
);
70+
}
71+
},
72+
),
73+
);
7474
}

0 commit comments

Comments
 (0)