.eslintrc.json 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. {
  2. "extends": [
  3. "eslint:recommended"
  4. ],
  5. "plugins": [
  6. "mocha-no-only"
  7. ],
  8. "parserOptions": {
  9. "ecmaVersion": 2017
  10. },
  11. "env": {
  12. "node": true,
  13. "es6": true
  14. },
  15. "rules": {
  16. "comma-style": "error",
  17. "indent": [
  18. "error",
  19. 2,
  20. {
  21. "SwitchCase": 1,
  22. "VariableDeclarator": 2
  23. }
  24. ],
  25. "keyword-spacing": "error",
  26. "no-whitespace-before-property": "error",
  27. "no-buffer-constructor": "warn",
  28. "no-console": "off",
  29. "no-multi-spaces": "error",
  30. "no-constant-condition": "off",
  31. "func-call-spacing": "error",
  32. "no-trailing-spaces": "error",
  33. "no-undef": "error",
  34. "no-unneeded-ternary": "error",
  35. "no-const-assign": "error",
  36. "no-useless-rename": "error",
  37. "no-dupe-keys": "error",
  38. "space-in-parens": [
  39. "error",
  40. "never"
  41. ],
  42. "spaced-comment": [
  43. "error",
  44. "always",
  45. {
  46. "block": {
  47. "markers": [
  48. "!"
  49. ],
  50. "balanced": true
  51. }
  52. }
  53. ],
  54. "key-spacing": [
  55. "error",
  56. {
  57. "beforeColon": false,
  58. "afterColon": true
  59. }
  60. ],
  61. "comma-spacing": [
  62. "error",
  63. {
  64. "before": false,
  65. "after": true
  66. }
  67. ],
  68. "array-bracket-spacing": 1,
  69. "arrow-spacing": [
  70. "error",
  71. {
  72. "before": true,
  73. "after": true
  74. }
  75. ],
  76. "object-curly-spacing": [
  77. "error",
  78. "always"
  79. ],
  80. "comma-dangle": [
  81. "error",
  82. "never"
  83. ],
  84. "no-unreachable": "error",
  85. "quotes": [
  86. "error",
  87. "single"
  88. ],
  89. "quote-props": [
  90. "error",
  91. "as-needed"
  92. ],
  93. "semi": "error",
  94. "no-extra-semi": "error",
  95. "semi-spacing": "error",
  96. "no-spaced-func": "error",
  97. "no-throw-literal": "error",
  98. "space-before-blocks": "error",
  99. "space-before-function-paren": [
  100. "error",
  101. "never"
  102. ],
  103. "space-infix-ops": "error",
  104. "space-unary-ops": "error",
  105. "no-var": "warn",
  106. "prefer-const": "warn",
  107. "strict": [
  108. "error",
  109. "global"
  110. ],
  111. "no-restricted-globals": [
  112. "error",
  113. {
  114. "name": "context",
  115. "message": "Don't use Mocha's global context"
  116. }
  117. ],
  118. "no-prototype-builtins": "off",
  119. "mocha-no-only/mocha-no-only": [
  120. "error"
  121. ]
  122. }
  123. }