Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 36 additions & 22 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import pluginReact from "@eslint-react/eslint-plugin";
import pluginReactHooks from "eslint-plugin-react-hooks";
import pluginJsxA11y from "eslint-plugin-jsx-a11y";
import pluginJsxA11y from "eslint-plugin-jsx-a11y-x";
import playwright from "eslint-plugin-playwright";
import { defineConfig, globalIgnores } from "eslint/config";

export default defineConfig([
globalIgnores(["build/**", "playwright-report/**", "test-results/**"]),
const reactHooksPortsOff = Object.fromEntries(
Object.keys(
pluginReact.configs["disable-conflict-eslint-plugin-react-hooks"]
.rules ?? {},
).map(name => [name.replace("react-hooks/", "@eslint-react/"), "off"]),
);

pluginJs.configs.recommended,
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
pluginReact.configs.flat["jsx-runtime"],
pluginJsxA11y.flatConfigs.recommended,
pluginReactHooks.configs.flat.recommended,
export default defineConfig([
globalIgnores(
["build/**", "playwright-report/**", "test-results/**"],
"code-explorer/global-ignores",
),
{
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
languageOptions: {
globals: globals.browser,
sourceType: "module",
},
name: "code-explorer/js",
files: ["**/*.{js,ts,tsx}"],
extends: [pluginJs.configs.recommended],
},
{
name: "code-explorer/ts",
files: ["**/*.{ts,tsx}"],
extends: [tseslint.configs.recommended],
rules: {
"react/prop-types": "off", // TypeScript handles type checking
"@typescript-eslint/ban-ts-comment": "off",
},
settings: {
react: {
version: "detect",
},
},
{
name: "code-explorer/app",
files: ["src/**/*.{ts,tsx}"],
extends: [
pluginReact.configs["recommended-typescript"],
pluginReactHooks.configs.flat.recommended,
pluginJsxA11y.configs.recommended,
],
rules: {
...reactHooksPortsOff,
"@eslint-react/no-array-index-key": "off",
"@eslint-react/use-state": "off",
},
},
{
files: ["e2e-tests/**"],
name: "code-explorer/e2e-tests",
files: ["e2e-tests/**/*.ts"],
extends: [playwright.configs["flat/recommended"]],
},
]);
Loading