Add eslint

This commit is contained in:
2026-04-17 14:31:10 +02:00
parent caee674448
commit 378108bd34
5 changed files with 766 additions and 33 deletions

28
eslint.config.js Normal file
View File

@@ -0,0 +1,28 @@
import js from "@eslint/js";
import globals from "globals";
import { defineConfig } from "eslint/config";
import stylistic from "@stylistic/eslint-plugin";
export default defineConfig([
{
files: ["**/*.{js,mjs,cjs}"],
plugins: { js, "@stylistic": stylistic },
extends: ["js/recommended"],
languageOptions: { globals: { ...globals.browser, ...globals.node } },
rules: {
"no-unused-vars": "off",
"no-undef": "off",
"no-var": "error",
"prefer-const": "error",
"no-redeclare": "error",
"@stylistic/semi": ["error", "always"],
"@stylistic/semi-spacing": ["error", { before: false, after: true }],
"@stylistic/no-tabs": "error",
"@stylistic/no-mixed-spaces-and-tabs": "error",
"@stylistic/quotes": ["error", "double"],
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/key-spacing": ["error", { beforeColon: false, afterColon: true }],
"@stylistic/keyword-spacing": ["error", { before: true, after: true }],
},
},
]);