mirror of
https://github.com/LukeHagar/arbiter.git
synced 2025-12-06 04:19:14 +00:00
67 lines
1.9 KiB
JavaScript
67 lines
1.9 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
import globals from "globals";
|
|
import tsParser from "@typescript-eslint/parser";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import js from "@eslint/js";
|
|
import { FlatCompat } from "@eslint/eslintrc";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all
|
|
});
|
|
|
|
export default defineConfig([globalIgnores(["**/dist", "**/node_modules", "**/coverage"]), {
|
|
extends: compat.extends(
|
|
"eslint:recommended",
|
|
"plugin:@typescript-eslint/recommended",
|
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
"prettier",
|
|
),
|
|
|
|
plugins: {
|
|
"@typescript-eslint": typescriptEslint,
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
|
|
parser: tsParser,
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
|
|
parserOptions: {
|
|
project: "./tsconfig.json",
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
"@typescript-eslint/explicit-function-return-type": "error",
|
|
"@typescript-eslint/no-explicit-any": "error",
|
|
|
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
argsIgnorePattern: "^_",
|
|
}],
|
|
|
|
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
"@typescript-eslint/no-unsafe-call": "error",
|
|
"@typescript-eslint/no-unsafe-return": "error",
|
|
|
|
"no-console": ["error", {
|
|
allow: ["warn", "error", "info"],
|
|
}],
|
|
|
|
eqeqeq: ["error", "always"],
|
|
"no-unused-vars": "off",
|
|
"prefer-const": "error",
|
|
"no-var": "error",
|
|
curly: "error",
|
|
},
|
|
}]); |