.eslintrc.cjs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * This is intended to be a basic starting point for linting in your app.
  3. * It relies on recommended configs out of the box for simplicity, but you can
  4. * and should modify this configuration to best suit your team's needs.
  5. */
  6. /** @type {import('eslint').Linter.Config} */
  7. module.exports = {
  8. root: true,
  9. parserOptions: {
  10. ecmaVersion: "latest",
  11. sourceType: "module",
  12. ecmaFeatures: {
  13. jsx: true,
  14. },
  15. },
  16. env: {
  17. browser: true,
  18. commonjs: true,
  19. es6: true,
  20. },
  21. ignorePatterns: ["!**/.server", "!**/.client"],
  22. // Base config
  23. extends: ["eslint:recommended"],
  24. overrides: [
  25. // React
  26. {
  27. files: ["**/*.{js,jsx,ts,tsx}"],
  28. plugins: ["react", "jsx-a11y"],
  29. extends: [
  30. "plugin:react/recommended",
  31. "plugin:react/jsx-runtime",
  32. "plugin:react-hooks/recommended",
  33. "plugin:jsx-a11y/recommended",
  34. ],
  35. settings: {
  36. react: {
  37. version: "detect",
  38. },
  39. formComponents: ["Form"],
  40. linkComponents: [
  41. { name: "Link", linkAttribute: "to" },
  42. { name: "NavLink", linkAttribute: "to" },
  43. ],
  44. "import/resolver": {
  45. typescript: {},
  46. },
  47. },
  48. },
  49. // Typescript
  50. {
  51. files: ["**/*.{ts,tsx}"],
  52. plugins: ["@typescript-eslint", "import"],
  53. parser: "@typescript-eslint/parser",
  54. settings: {
  55. "import/internal-regex": "^~/",
  56. "import/resolver": {
  57. node: {
  58. extensions: [".ts", ".tsx"],
  59. },
  60. typescript: {
  61. alwaysTryTypes: true,
  62. },
  63. },
  64. },
  65. extends: [
  66. "plugin:@typescript-eslint/recommended",
  67. "plugin:import/recommended",
  68. "plugin:import/typescript",
  69. ],
  70. },
  71. // Node
  72. {
  73. files: [".eslintrc.cjs"],
  74. env: {
  75. node: true,
  76. },
  77. },
  78. ],
  79. };