From 1c254f110c57ae678d167b1df98c6c5a1be6cdad Mon Sep 17 00:00:00 2001 From: cardistymo Date: Wed, 10 Jul 2024 12:17:05 +0200 Subject: [PATCH] Migrate ESLint to new config file format --- eslint.config.mjs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 eslint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..ba84f86 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,28 @@ +import globals from "globals"; +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 [...compat.extends("eslint:recommended"), { + languageOptions: { + globals: { + ...globals.browser, + }, + + ecmaVersion: "latest", + sourceType: "module", + }, + + rules: { + "no-unused-vars": 0, + }, +}]; \ No newline at end of file