eslint config

pull/2/head
Matthew 2024-10-25 16:56:43 -04:00
parent 43709e07f9
commit 77a25e1681
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
1 changed files with 47 additions and 0 deletions

47
eslint.config.mjs Normal file
View File

@ -0,0 +1,47 @@
// eslint.config.mjs
import js from "@eslint/js";
import typescript from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import prettier from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier";
import globals from "globals";
export default [
// Base ESLint configuration
js.configs.recommended,
// TypeScript configuration
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptParser,
globals: {
...globals.node,
},
parserOptions: {
ecmaVersion: "latest", // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
},
},
plugins: {
"@typescript-eslint": typescript,
},
rules: {
...typescript.configs.recommended.rules,
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
},
},
// Prettier configuration
{
plugins: {
prettier: prettierPlugin,
},
rules: {
...prettier.rules,
"prettier/prettier": "error",
},
},
];