Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

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

Check warning on line 3 in eslint.config.js

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (tsparser)
const prettier = require("eslint-config-prettier");

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,

Check warning on line 26 in eslint.config.js

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (tsparser)
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
globals: {
console: "readonly",
process: "readonly",
Buffer: "readonly",
__dirname: "readonly",
__filename: "readonly",
global: "readonly",
module: "readonly",
require: "readonly",
exports: "readonly",
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",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
args: "after-used",
},
],
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
args: "after-used",
},
],
"@typescript-eslint/no-var-requires": "off",
},
},
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "commonjs",
globals: {
console: "readonly",
process: "readonly",
Buffer: "readonly",
__dirname: "readonly",
__filename: "readonly",
global: "readonly",
module: "readonly",
require: "readonly",
exports: "readonly",
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