.eslintrc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {
  2. // Configuration for JavaScript files
  3. "extends": [
  4. "airbnb-base",
  5. "plugin:prettier/recommended"
  6. ],
  7. "rules": {
  8. "prettier/prettier": [
  9. "error",
  10. {
  11. "singleQuote": true,
  12. "endOfLine": "auto"
  13. }
  14. ]
  15. },
  16. "overrides": [
  17. // Configuration for TypeScript files
  18. {
  19. "files": ["**/*.ts", "**/__tests__/*.test.ts"],
  20. "plugins": [
  21. "@typescript-eslint",
  22. "unused-imports",
  23. "simple-import-sort"
  24. ],
  25. "extends": [
  26. "airbnb-typescript",
  27. "plugin:prettier/recommended"
  28. ],
  29. "parserOptions": {
  30. "project": "./tsconfig.json"
  31. },
  32. "rules": {
  33. "prettier/prettier": [
  34. "error",
  35. {
  36. "singleQuote": true,
  37. "endOfLine": "auto"
  38. }
  39. ],
  40. "@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier
  41. "@typescript-eslint/consistent-type-imports": "error", // Ensure `import type` is used when it's necessary
  42. "import/prefer-default-export": "off", // Named export is easier to refactor automatically
  43. "simple-import-sort/imports": "error", // Import configuration for `eslint-plugin-simple-import-sort`
  44. "simple-import-sort/exports": "error", // Export configuration for `eslint-plugin-simple-import-sort`
  45. "@typescript-eslint/no-unused-vars": "off",
  46. "react/jsx-filename-extension": "off", // Gives error
  47. "unused-imports/no-unused-imports": "error",
  48. "unused-imports/no-unused-vars": [
  49. "error",
  50. { "argsIgnorePattern": "^_" }
  51. ]
  52. }
  53. }
  54. ]
  55. }