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", + }, + }, +];