.eslintrc.json 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {
  2. "root": true,
  3. "extends": [
  4. "plugin:import/errors",
  5. "plugin:import/warnings",
  6. "plugin:unicorn/recommended",
  7. "xo",
  8. "xo/browser"
  9. ],
  10. "rules": {
  11. "arrow-body-style": "off",
  12. "capitalized-comments": "off",
  13. "comma-dangle": [
  14. "error",
  15. "never"
  16. ],
  17. "indent": [
  18. "error",
  19. 2,
  20. {
  21. "MemberExpression": "off",
  22. "SwitchCase": 1
  23. }
  24. ],
  25. "max-params": [
  26. "warn",
  27. 5
  28. ],
  29. "multiline-ternary": [
  30. "error",
  31. "always-multiline"
  32. ],
  33. "new-cap": [
  34. "error",
  35. {
  36. "properties": false
  37. }
  38. ],
  39. "no-console": "error",
  40. "no-negated-condition": "off",
  41. "object-curly-spacing": [
  42. "error",
  43. "always"
  44. ],
  45. "operator-linebreak": [
  46. "error",
  47. "after"
  48. ],
  49. "semi": [
  50. "error",
  51. "never"
  52. ],
  53. "unicorn/explicit-length-check": "off",
  54. "unicorn/no-array-callback-reference": "off",
  55. "unicorn/no-array-for-each": "off",
  56. "unicorn/no-array-method-this-argument": "off",
  57. "unicorn/no-null": "off",
  58. "unicorn/no-unused-properties": "error",
  59. "unicorn/prefer-array-flat": "off",
  60. "unicorn/prefer-dom-node-dataset": "off",
  61. "unicorn/prefer-export-from": "off",
  62. "unicorn/prefer-module": "off",
  63. "unicorn/prefer-query-selector": "off",
  64. "unicorn/prefer-spread": "off",
  65. "unicorn/prefer-string-replace-all": "off",
  66. "unicorn/prevent-abbreviations": "off"
  67. },
  68. "overrides": [
  69. {
  70. "files": ["*.ts", "*.tsx"],
  71. "extends": [
  72. "plugin:import/typescript",
  73. "xo-typescript"
  74. ],
  75. "rules": {
  76. "@typescript-eslint/comma-dangle": [
  77. "error",
  78. "never"
  79. ],
  80. "@typescript-eslint/indent": [
  81. "error",
  82. 2,
  83. {
  84. "MemberExpression": "off",
  85. "SwitchCase": 1
  86. }
  87. ],
  88. "@typescript-eslint/naming-convention": [
  89. "error",
  90. {
  91. "selector": "variable",
  92. "format": ["camelCase", "StrictPascalCase", "UPPER_CASE"]
  93. }
  94. ],
  95. "@typescript-eslint/object-curly-spacing": [
  96. "error",
  97. "always"
  98. ],
  99. "@typescript-eslint/semi": [
  100. "error",
  101. "never"
  102. ]
  103. }
  104. },
  105. {
  106. "files": ["src/config/**"],
  107. "env": {
  108. "browser": false,
  109. "node": true
  110. },
  111. "parserOptions": {
  112. "sourceType": "module"
  113. },
  114. "rules": {
  115. "no-console": "off",
  116. "unicorn/prefer-top-level-await": "off"
  117. }
  118. }
  119. ]
  120. }