eslint.config.mjs 1005 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import eslint from '@eslint/js';
  2. import tseslint from 'typescript-eslint';
  3. import reactRefresh from 'eslint-plugin-react-refresh';
  4. import reactHooks from 'eslint-plugin-react-hooks';
  5. import eslintConfigPrettier from 'eslint-config-prettier/flat';
  6. import globals from 'globals';
  7. export default tseslint.config(
  8. eslint.configs.recommended,
  9. tseslint.configs.recommended,
  10. reactRefresh.configs.recommended,
  11. reactHooks.configs['recommended-latest'],
  12. eslintConfigPrettier,
  13. {
  14. rules: {
  15. 'react-refresh/only-export-components': 'warn',
  16. '@typescript-eslint/no-unused-vars': [
  17. 'error',
  18. {
  19. varsIgnorePattern: '^_',
  20. argsIgnorePattern: '^_',
  21. destructuredArrayIgnorePattern: '^_',
  22. ignoreRestSiblings: true,
  23. },
  24. ],
  25. },
  26. },
  27. {
  28. ignores: ['**/dist/', '**/node_modules/', '**/coverage/'],
  29. },
  30. {
  31. files: ['scripts/*.mjs'],
  32. languageOptions: {
  33. globals: {
  34. ...globals.node,
  35. },
  36. },
  37. },
  38. );