Skip to content

Commit dc8e9c2

Browse files
committed
fix: enforce zero-warning lint and resolve curly/test warnings
- add braces for single-line conditionals in normalizeMap - remove unnecessary eslint-disable; use import with targeted ts-ignore - make lint fail on warnings via --max-warnings=0 Refs: internal quality gate for CI
1 parent 5290005 commit dc8e9c2

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"watch-tests": "tsc -p . -w --outDir out",
4646
"pretest": "npm run compile-tests && npm run compile && npm run lint",
4747
"check-types": "tsc --noEmit",
48-
"lint": "eslint src",
48+
"lint": "eslint src --max-warnings=0",
4949
"test": "vscode-test",
5050
"vsce:package": "vsce package",
5151
"vsce:publish": "vsce publish",

src/extension.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,18 @@ function getCommentSyntax(extension: string): string | null {
100100
}
101101

102102
function normalizeMap(map: Record<string, string> | undefined): Record<string, string> {
103-
if (!map) return {};
103+
if (!map) {
104+
return {};
105+
}
104106
const out: Record<string, string> = {};
105107
for (const [k, v] of Object.entries(map)) {
106-
if (!k) continue;
108+
if (!k) {
109+
continue;
110+
}
107111
const key = k.startsWith('.') ? k : `.${k}`;
108-
if (typeof v === 'string' && v.trim().length > 0) out[key] = v;
112+
if (typeof v === 'string' && v.trim().length > 0) {
113+
out[key] = v;
114+
}
109115
}
110116
return out;
111117
}

src/test/configOverride.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as assert from 'assert';
22
import * as vscode from 'vscode';
3-
4-
// eslint-disable-next-line @typescript-eslint/no-var-requires
5-
const ext = require('../../dist/extension.js');
3+
// @ts-ignore - importing built CJS bundle for runtime
4+
import * as ext from '../../dist/extension.js';
65

76
suite('Configuration override', () => {
87
test('user settings override default map', async () => {
@@ -17,4 +16,3 @@ suite('Configuration override', () => {
1716
}
1817
});
1918
});
20-

0 commit comments

Comments
 (0)