chore(eslint): upgrade to eslint v9 and flat config (#2909)

This commit is contained in:
Will Hack
2025-04-07 03:16:03 +02:00
committed by GitHub
parent 6f85f48b19
commit a34839f001
6 changed files with 310 additions and 230 deletions

28
docs/eslint.config.mjs Normal file
View File

@@ -0,0 +1,28 @@
import { defineConfig, globalIgnores } from "eslint/config";
import globals from "globals";
import js from "@eslint/js";
import pluginReact from "eslint-plugin-react";
import * as mdx from "eslint-plugin-mdx";
export default defineConfig([
globalIgnores([".cache-loader/", ".docusaurus/", "build/"]),
{ files: ["**/*.{js,jsx,md,mdx}"] },
{
plugins: { js },
extends: ["js/recommended"],
},
mdx.flat,
pluginReact.configs.flat.recommended,
pluginReact.configs.flat["jsx-runtime"],
{
languageOptions: {
globals: { ...globals.browser, ...globals.commonjs, ...globals.node },
},
rules: { "react/no-unescaped-entities": "off" },
settings: {
react: {
version: "detect",
},
},
},
]);