feat(client): add recommended rules

This commit is contained in:
Elian Doran 2025-03-08 02:45:40 +02:00
parent 0273fad0ba
commit 79adb0b20e
No known key found for this signature in database
3 changed files with 35 additions and 6 deletions

20
package-lock.json generated
View File

@ -166,6 +166,7 @@
"electron": "34.3.1", "electron": "34.3.1",
"eslint": "9.21.0", "eslint": "9.21.0",
"esm": "3.2.25", "esm": "3.2.25",
"globals": "16.0.0",
"happy-dom": "17.3.0", "happy-dom": "17.3.0",
"i18next-http-backend": "3.0.2", "i18next-http-backend": "3.0.2",
"jsdoc": "4.0.4", "jsdoc": "4.0.4",
@ -2242,6 +2243,19 @@
"url": "https://github.com/sponsors/epoberezkin" "url": "https://github.com/sponsors/epoberezkin"
} }
}, },
"node_modules/@eslint/eslintrc/node_modules/globals": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
@ -11605,9 +11619,9 @@
} }
}, },
"node_modules/globals": { "node_modules/globals": {
"version": "14.0.0", "version": "16.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz",
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {

View File

@ -219,6 +219,7 @@
"electron": "34.3.1", "electron": "34.3.1",
"eslint": "9.21.0", "eslint": "9.21.0",
"esm": "3.2.25", "esm": "3.2.25",
"globals": "16.0.0",
"happy-dom": "17.3.0", "happy-dom": "17.3.0",
"i18next-http-backend": "3.0.2", "i18next-http-backend": "3.0.2",
"jsdoc": "4.0.4", "jsdoc": "4.0.4",

View File

@ -1,9 +1,23 @@
export async function lint(code: string) { export async function lint(code: string) {
const Linter = (await import("eslint-linter-browserify")).Linter; const Linter = (await import("eslint-linter-browserify")).Linter;
const js = (await import("@eslint/js"));
const globals = (await import("globals"));
return new Linter().verify(code, { return new Linter().verify(code, [
js.configs.recommended,
}); {
languageOptions: {
parserOptions: {
ecmaVersion: 2024
},
globals: {
...globals.browser,
api: "readonly"
}
},
rules: { }
}
]);
} }