react.js 949 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import js from "@eslint/js"
  2. import eslintConfigPrettier from "eslint-config-prettier"
  3. import typescriptEslint from "typescript-eslint"
  4. import pluginReactHooks from "eslint-plugin-react-hooks"
  5. import pluginReact from "eslint-plugin-react"
  6. import globals from "globals"
  7. import { config } from "./base.js"
  8. /**
  9. * @type {import("eslint").Linter.Config[]}
  10. */
  11. export const reactConfig = [
  12. ...config,
  13. js.configs.recommended,
  14. eslintConfigPrettier,
  15. ...typescriptEslint.configs.recommended,
  16. {
  17. ...pluginReact.configs.flat.recommended,
  18. languageOptions: {
  19. ...pluginReact.configs.flat.recommended.languageOptions,
  20. globals: {
  21. ...globals.serviceworker,
  22. },
  23. },
  24. },
  25. {
  26. plugins: {
  27. "react-hooks": pluginReactHooks,
  28. },
  29. settings: { react: { version: "detect" } },
  30. rules: {
  31. ...pluginReactHooks.configs.recommended.rules,
  32. // React scope no longer necessary with new JSX transform.
  33. "react/react-in-jsx-scope": "off",
  34. },
  35. },
  36. ]