.eslintrc.json 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {
  2. "env": {
  3. "browser": true,
  4. "node": true
  5. },
  6. "parserOptions": {
  7. "ecmaVersion": 2018,
  8. "sourceType": "module",
  9. "ecmaFeatures": {
  10. "impliedStrict": true
  11. }
  12. },
  13. "rules": {
  14. "indent": "off",
  15. "arrow-parens": [
  16. "off",
  17. "as-needed"
  18. ],
  19. "brace-style": "off",
  20. "comma-spacing": "off",
  21. "space-infix-ops": "error",
  22. "comma-dangle": "off",
  23. "eqeqeq": [
  24. "error",
  25. "smart"
  26. ],
  27. "import/order": "off",
  28. "no-eval": "warn",
  29. "no-new-wrappers": "warn",
  30. "no-trailing-spaces": "error",
  31. "no-unsafe-finally": "warn",
  32. "no-var": "error",
  33. "spaced-comment": "error",
  34. "semi": "warn",
  35. "no-restricted-syntax": [
  36. "error",
  37. {
  38. "selector": "ExportDefaultDeclaration",
  39. "message": "Default exports are not allowed"
  40. }
  41. ],
  42. "no-throw-literal": "error",
  43. "key-spacing": "error",
  44. "object-curly-spacing": ["error", "always"],
  45. "array-bracket-spacing": "error",
  46. "space-in-parens": "error",
  47. "computed-property-spacing": "error",
  48. "prefer-const": ["error", {
  49. "destructuring": "all",
  50. "ignoreReadBeforeAssign": false
  51. }],
  52. "space-before-function-paren": "off",
  53. "func-call-spacing": "off",
  54. "no-multi-spaces": "error",
  55. "block-spacing": "error",
  56. "keyword-spacing": "off"
  57. },
  58. "overrides": [
  59. {
  60. "files": ["**/*.ts", "**/*.tsx"],
  61. "parser": "@typescript-eslint/parser",
  62. "parserOptions": {
  63. "project": ["tsconfig.json", "tsconfig.commonjs.json"],
  64. "sourceType": "module"
  65. },
  66. "plugins": [
  67. "@typescript-eslint"
  68. ],
  69. "rules": {
  70. "@typescript-eslint/ban-types": "off",
  71. "@typescript-eslint/class-name-casing": "off",
  72. "@typescript-eslint/indent": [
  73. "error",
  74. 4
  75. ],
  76. "@typescript-eslint/member-delimiter-style": [
  77. "off",
  78. {
  79. "multiline": {
  80. "delimiter": "none",
  81. "requireLast": true
  82. },
  83. "singleline": {
  84. "delimiter": "semi",
  85. "requireLast": false
  86. }
  87. }
  88. ],
  89. "@typescript-eslint/prefer-namespace-keyword": "warn",
  90. "@typescript-eslint/quotes": [
  91. "error",
  92. "single",
  93. {
  94. "avoidEscape": true,
  95. "allowTemplateLiterals": true
  96. }
  97. ],
  98. "@typescript-eslint/semi": [
  99. "off",
  100. null
  101. ],
  102. "@typescript-eslint/type-annotation-spacing": "error",
  103. "@typescript-eslint/brace-style": [
  104. "error",
  105. "1tbs", { "allowSingleLine": true }
  106. ],
  107. "@typescript-eslint/comma-spacing": "error",
  108. "@typescript-eslint/space-before-function-paren": ["error", {
  109. "anonymous": "always",
  110. "named": "never",
  111. "asyncArrow": "always"
  112. }],
  113. "@typescript-eslint/func-call-spacing": ["error"],
  114. "@typescript-eslint/keyword-spacing": ["error"]
  115. }
  116. }
  117. ]
  118. }