Skip to content

Commit bcfc30b

Browse files
committed
Reorder ESLint rules and improve test errors
Move ...strictRules after the TypeScript recommended rules in eslint.config.js so strictRules override the recommended settings. Improve htmlhint test failure diagnostics by capturing the caught error message (or 'Unknown error') and including the config path and message in assert.fail, making failures easier to debug.
1 parent 3ea591f commit bcfc30b

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ module.exports = [
4545
"@typescript-eslint": tseslint,
4646
},
4747
rules: {
48-
...strictRules,
4948
...tseslint.configs.recommended.rules,
49+
...strictRules,
5050
"@typescript-eslint/explicit-module-boundary-types": "off",
5151
"@typescript-eslint/no-empty-interface": "off",
5252
"@typescript-eslint/no-explicit-any": "off",

test/suite/htmlhint.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,22 @@ suite("HTMLHint Test Suite", () => {
3333
);
3434
try {
3535
await vscode.workspace.fs.stat(vscode.Uri.file(testConfigPath));
36-
} catch {
37-
assert.fail(".htmlhintrc should exist in test config directory");
36+
} catch (error) {
37+
const message =
38+
error instanceof Error ? error.message : "Unknown error";
39+
assert.fail(
40+
`.htmlhintrc should exist in test config directory: ${testConfigPath} (${message})`,
41+
);
3842
}
3943
return;
4044
}
4145

4246
const configPath = path.join(workspaceFolder.uri.fsPath, ".htmlhintrc");
4347
try {
4448
await vscode.workspace.fs.stat(vscode.Uri.file(configPath));
45-
} catch {
46-
assert.fail(".htmlhintrc should exist");
49+
} catch (error) {
50+
const message = error instanceof Error ? error.message : "Unknown error";
51+
assert.fail(`.htmlhintrc should exist: ${configPath} (${message})`);
4752
}
4853
});
4954
});

0 commit comments

Comments
 (0)