.eslintrc.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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": "off",
  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. "space-before-blocks": "error",
  58. "semi-spacing": "error"
  59. },
  60. "overrides": [
  61. {
  62. "files": ["**/*.ts", "**/*.tsx"],
  63. "parser": "@typescript-eslint/parser",
  64. "parserOptions": {
  65. "project": ["tsconfig.json", "tsconfig.commonjs.json"],
  66. "sourceType": "module"
  67. },
  68. "plugins": [
  69. "@typescript-eslint"
  70. ],
  71. "rules": {
  72. "@typescript-eslint/ban-types": "off",
  73. "@typescript-eslint/class-name-casing": "off",
  74. "@typescript-eslint/indent": [
  75. "error",
  76. 4
  77. ],
  78. "@typescript-eslint/member-delimiter-style": [
  79. "off",
  80. {
  81. "multiline": {
  82. "delimiter": "none",
  83. "requireLast": true
  84. },
  85. "singleline": {
  86. "delimiter": "semi",
  87. "requireLast": false
  88. }
  89. }
  90. ],
  91. "@typescript-eslint/prefer-namespace-keyword": "warn",
  92. "@typescript-eslint/quotes": [
  93. "error",
  94. "single",
  95. {
  96. "avoidEscape": true,
  97. "allowTemplateLiterals": true
  98. }
  99. ],
  100. "@typescript-eslint/semi": [
  101. "off",
  102. null
  103. ],
  104. "@typescript-eslint/type-annotation-spacing": "error",
  105. "@typescript-eslint/brace-style": [
  106. "error",
  107. "1tbs", { "allowSingleLine": true }
  108. ],
  109. "@typescript-eslint/comma-spacing": "error",
  110. "@typescript-eslint/space-infix-ops": "error",
  111. "@typescript-eslint/space-before-function-paren": ["error", {
  112. "anonymous": "always",
  113. "named": "never",
  114. "asyncArrow": "always"
  115. }],
  116. "@typescript-eslint/func-call-spacing": ["error"],
  117. "@typescript-eslint/keyword-spacing": ["error"]
  118. }
  119. }
  120. ]
  121. }