Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"ruleset",
"sarif",
"tagname",
"tsparser",
"vite",
"VSIX",
"ZIZMOR"
Expand Down
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

89 changes: 89 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
const js = require("@eslint/js");
const tseslint = require("@typescript-eslint/eslint-plugin");
const tsparser = require("@typescript-eslint/parser");
const prettier = require("eslint-config-prettier");
const globals = require("globals");

module.exports = [
{
ignores: [
"test/**",
"**/*.d.ts",
"out/**",
"htmlhint/out/**",
"htmlhint-server/out/**",
".vscode-test/**",
"node_modules/**",
"htmlhint/node_modules/**",
"htmlhint-server/node_modules/**",
"htmlhint/vscode-htmlhint-*.vsix",
"**/*.vsix",
],
},
js.configs.recommended,
{
files: ["**/*.ts"],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
globals: {
...globals.node,
NodeJS: "readonly",
},
},
plugins: {
"@typescript-eslint": tseslint,
},
rules: {
...tseslint.configs.recommended.rules,
"no-console": "error",
"no-empty": "off",
"no-var": "off",
"prefer-const": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
// Disable base no-unused-vars rule for TypeScript files to prevent conflicts
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
args: "after-used",
},
],
"@typescript-eslint/no-var-requires": "off",
},
},
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "commonjs",
globals: {
...globals.node,
NodeJS: "readonly",
},
},
rules: {
"no-console": "error",
"no-empty": "off",
"no-var": "off",
"prefer-const": "off",
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
args: "after-used",
},
],
},
},
prettier,
];
17 changes: 3 additions & 14 deletions htmlhint-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ interface HtmlHintConfig {

let settings: Settings | null = null;
let linter: {
verify: (text: string, config?: HtmlHintConfig) => htmlhint.Error[];
verify: (_text: string, _config?: HtmlHintConfig) => htmlhint.Error[];
} | null = null;

/**
Expand All @@ -82,9 +82,8 @@ let htmlhintrcOptions: Record<string, HtmlHintConfig | null | undefined> = {};
*/
function makeDiagnostic(
problem: htmlhint.Error,
document: TextDocument,
_document: TextDocument,
): Diagnostic {
const lines = document.getText().split("\n");
const col = problem.col - 1;
const endCol = problem.col + (problem.raw?.length || 0) - 1;

Expand Down Expand Up @@ -2190,16 +2189,7 @@ async function createAutoFixes(
}

connection.onInitialize(
(params: InitializeParams, token: CancellationToken) => {
let initOptions: {
nodePath: string;
} = params.initializationOptions;
let nodePath = initOptions
? initOptions.nodePath
? initOptions.nodePath
: undefined
: undefined;

(_params: InitializeParams, _token: CancellationToken) => {
// Since Files API is no longer available, we'll use embedded htmlhint directly
linter = (htmlhint.default ||
htmlhint.HTMLHint ||
Expand Down Expand Up @@ -2281,7 +2271,6 @@ function doValidate(connection: Connection, document: TextDocument): void {
}

let contents = document.getText();
let lines = contents.split("\n");

let config = getConfiguration(fsPath);
trace(`[DEBUG] Loaded config: ${JSON.stringify(config)}`);
Expand Down
12 changes: 6 additions & 6 deletions htmlhint/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions htmlhint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"Linters"
],
"engines": {
"vscode": "^1.89.0"
"vscode": "^1.101.0"
},
"activationEvents": [
"onLanguage:html",
Expand Down Expand Up @@ -91,8 +91,8 @@
"package": "vsce package"
},
"devDependencies": {
"@types/node": "^22.15.31",
"@types/vscode": "^1.89.0",
"@types/node": "^22.19.1",
"@types/vscode": "^1.101.0",
"@vscode/test-electron": "^2.5.2",
"typescript": "5.5.4"
},
Expand Down
Loading