Files
authentik/packages/eslint-config/lib/react-config.js
Teffen Ellis 6f9db3fccf web: ESLint Typing Fixes (#18362)
* Bump engine.

* Fix ESLint types.
2025-11-25 12:02:09 -05:00

44 lines
1.1 KiB
JavaScript

import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import { defineConfig } from "eslint/config";
// @ts-check
const files = ["**/*.{js,jsx,mjs,cjs,ts,tsx}"];
/**
* ESLint configuration for React authentik projects.
*/
export const reactConfig = defineConfig(
{
files,
extends: [
// @ts-expect-error 2322 - Type definition isn't specific enough to omit undefined.
react.configs.flat.recommended,
],
rules: {
"react/jsx-uses-react": 0,
"react/display-name": "off",
"react/jsx-curly-brace-presence": "error",
"react/jsx-no-leaked-render": "error",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
},
settings: {
react: {
version: "detect",
},
},
},
{
files,
extends: [reactHooks.configs.flat.recommended],
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
},
);
export default reactConfig;