eslint.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import js from '@eslint/js';
  2. import tseslint from '@typescript-eslint/eslint-plugin';
  3. import tsparser from '@typescript-eslint/parser';
  4. import reactPlugin from 'eslint-plugin-react';
  5. import reactHooks from 'eslint-plugin-react-hooks';
  6. export default [
  7. {
  8. files: ['**/*.{js,jsx,ts,tsx}'],
  9. languageOptions: {
  10. parser: tsparser,
  11. ecmaVersion: 'latest',
  12. sourceType: 'module',
  13. parserOptions: {
  14. ecmaFeatures: {
  15. jsx: true
  16. }
  17. }
  18. },
  19. plugins: {
  20. '@typescript-eslint': tseslint,
  21. 'react': reactPlugin,
  22. 'react-hooks': reactHooks
  23. },
  24. rules: {
  25. ...js.configs.recommended.rules,
  26. ...tseslint.configs.recommended.rules,
  27. ...reactPlugin.configs.recommended.rules,
  28. ...reactHooks.configs.recommended.rules,
  29. 'react/react-in-jsx-scope': 'off',
  30. '@typescript-eslint/no-unused-vars': ['error', {
  31. argsIgnorePattern: '^_',
  32. varsIgnorePattern: '^_'
  33. }],
  34. '@typescript-eslint/no-explicit-any': 'warn'
  35. },
  36. settings: {
  37. react: {
  38. version: 'detect'
  39. }
  40. }
  41. }
  42. ];