.eslintrc.json 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. },
  53. "overrides": [
  54. {
  55. "files": ["**/*.ts", "**/*.tsx"],
  56. "parser": "@typescript-eslint/parser",
  57. "parserOptions": {
  58. "project": ["tsconfig.json", "tsconfig.commonjs.json"],
  59. "sourceType": "module"
  60. },
  61. "plugins": [
  62. "@typescript-eslint"
  63. ],
  64. "rules": {
  65. "@typescript-eslint/ban-types": "off",
  66. "@typescript-eslint/class-name-casing": "off",
  67. "@typescript-eslint/indent": [
  68. "error",
  69. 4
  70. ],
  71. "@typescript-eslint/member-delimiter-style": [
  72. "off",
  73. {
  74. "multiline": {
  75. "delimiter": "none",
  76. "requireLast": true
  77. },
  78. "singleline": {
  79. "delimiter": "semi",
  80. "requireLast": false
  81. }
  82. }
  83. ],
  84. "@typescript-eslint/prefer-namespace-keyword": "warn",
  85. "@typescript-eslint/quotes": [
  86. "error",
  87. "single",
  88. {
  89. "avoidEscape": true,
  90. "allowTemplateLiterals": true
  91. }
  92. ],
  93. "@typescript-eslint/semi": [
  94. "off",
  95. null
  96. ],
  97. "@typescript-eslint/type-annotation-spacing": "error",
  98. "@typescript-eslint/brace-style": [
  99. "error",
  100. "1tbs", { "allowSingleLine": true }
  101. ],
  102. "@typescript-eslint/comma-spacing": "error"
  103. }
  104. }
  105. ]
  106. }