From 77a25e16816c9274a12bd77ed1637601877543bb Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 25 Oct 2024 16:56:43 -0400 Subject: [PATCH] eslint config --- eslint.config.mjs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 eslint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..a93fc86 --- /dev/null +++ b/eslint.config.mjs @@ -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", + }, + }, +];