.eslintrc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {
  2. "env": {
  3. "browser": true,
  4. "es6": true
  5. },
  6. "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/eslint-recommended", "prettier", "prettier/react", "prettier/@typescript-eslint"],
  7. "globals": {
  8. "Atomics": "readonly",
  9. "SharedArrayBuffer": "readonly"
  10. },
  11. "parser": "@typescript-eslint/parser",
  12. "parserOptions": {
  13. "ecmaFeatures": {
  14. "jsx": true
  15. },
  16. "ecmaVersion": 2018,
  17. "sourceType": "module"
  18. },
  19. "plugins": ["react", "@typescript-eslint", "react-hooks"],
  20. "rules": {
  21. "semi": ["error", "never"],
  22. "no-multiple-empty-lines": [1, { "max": 2 }], //空行最多不能超过2行
  23. "comma-dangle": [2, "never"],
  24. "react/prop-types": 0,
  25. "array-bracket-spacing": ["error", "always"],
  26. "object-curly-spacing": ["error", "always"],
  27. "react-hooks/rules-of-hooks": "error",
  28. "react/self-closing-comp": ["error", {
  29. "component": true,
  30. "html": true
  31. }]
  32. // "react-hooks/exhaustive-deps": "warn"
  33. },
  34. "settings": {
  35. "react": {
  36. "version": "detect"
  37. }
  38. }
  39. }