eslint.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import js from '@eslint/js';
  2. import prettier from 'eslint-config-prettier';
  3. import react from 'eslint-plugin-react';
  4. import reactHooks from 'eslint-plugin-react-hooks';
  5. import globals from 'globals';
  6. import typescript from 'typescript-eslint';
  7. /** @type {import('eslint').Linter.Config[]} */
  8. export default [
  9. js.configs.recommended,
  10. ...typescript.configs.recommended,
  11. {
  12. ...react.configs.flat.recommended,
  13. ...react.configs.flat['jsx-runtime'], // Required for React 17+
  14. languageOptions: {
  15. globals: {
  16. ...globals.browser,
  17. },
  18. },
  19. rules: {
  20. 'react/react-in-jsx-scope': 'off',
  21. 'react/prop-types': 'off',
  22. 'react/no-unescaped-entities': 'off',
  23. },
  24. settings: {
  25. react: {
  26. version: 'detect',
  27. },
  28. },
  29. },
  30. {
  31. plugins: {
  32. 'react-hooks': reactHooks,
  33. },
  34. rules: {
  35. 'react-hooks/rules-of-hooks': 'error',
  36. 'react-hooks/exhaustive-deps': 'warn',
  37. },
  38. },
  39. {
  40. ignores: ['vendor', 'node_modules', 'public', 'bootstrap/ssr', 'tailwind.config.js'],
  41. },
  42. prettier, // Turn off all rules that might conflict with Prettier
  43. ];