.eslintrc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. root: true
  2. env:
  3. mocha: true
  4. node: true
  5. # globals:
  6. #########################
  7. ## Only add globals if you're absolutely certain they need to be globals
  8. ##########################
  9. # console: true
  10. #########################
  11. ## set to 0 to allow
  12. ## set to 1 to disallow as warning
  13. ## set to 2 to disallow as error
  14. #########################
  15. rules:
  16. #########################
  17. ## Optional Rules
  18. #########################
  19. # Disallow use of `console`
  20. no-console: 2
  21. # Disallow warning comments
  22. no-warning-comments:
  23. - 1
  24. - terms:
  25. - todo
  26. - fixme
  27. location: anywhere
  28. # Warns when variables are defined but never used
  29. no-unused-vars: 1
  30. # Enforces comma style (first or last)
  31. comma-style:
  32. - 2
  33. - last
  34. # Enforces one true `this` variable
  35. consistent-this:
  36. - 2
  37. - self
  38. # Allows dangling underscores in identifiers
  39. no-underscore-dangle: 2
  40. # Enforces function expressions to have a name
  41. func-names: 0
  42. # Set maximum depth of nested callbacks
  43. max-nested-callbacks:
  44. - 1
  45. - 3
  46. #########################
  47. ## Core Rules
  48. ##########################
  49. # Enforces camel case names
  50. camelcase: 2
  51. # Prohibit use of == and != in favor of === and !==
  52. eqeqeq: 2
  53. # Suppresses warnings about == null comparisons
  54. no-eq-null: 2
  55. # No mixing tabs and spaces, with 2 spaces only
  56. no-mixed-spaces-and-tabs: 2
  57. # Prohibits use of a variable before it is defined
  58. no-use-before-define: 2
  59. # Requires capitalized names for constructor functions
  60. new-cap: 2
  61. # Prohibits use of explicitly undeclared variables
  62. no-undef: 2
  63. # Enforces Use Strict at the top of function scope
  64. strict:
  65. - 2
  66. - global
  67. # Requires variable declarations to be at the top
  68. vars-on-top: 2
  69. # Enforce curly braces around blocks in loops and conditionals
  70. curly: 2
  71. # Prohibits the use of immediate function invocations w/o wrapping in parentheses
  72. wrap-iife: 2
  73. # Prohibits `argument.caller` and `argument.callee`
  74. no-caller: 2
  75. # Requires all `for in` loops to filter object's items
  76. guard-for-in: 2
  77. # Prohibits comparing a variable against itself
  78. no-self-compare: 2
  79. # Prohibits use of `undefined` variable
  80. no-undefined: 0
  81. # Prohibits nested ternaries
  82. no-nested-ternary: 2
  83. # Enforces a space before blocks
  84. space-before-blocks:
  85. - 2
  86. - always
  87. # Enforces spaces following keywords
  88. keyword-spacing:
  89. - 2
  90. - after: true
  91. # Enforces quoted property names
  92. quote-props:
  93. - 2
  94. - always
  95. # Enforces padded blocks
  96. padded-blocks:
  97. - 1
  98. - never
  99. # Enforce functions as expressions
  100. func-style:
  101. - 2
  102. - expression
  103. # Require brace style
  104. brace-style:
  105. - 2
  106. - stroustrup
  107. # Prohibits Yoda conditions
  108. yoda:
  109. - 2
  110. - never
  111. # Enforce use of single quotation marks for strings.
  112. quotes:
  113. - 2
  114. - single
  115. # Disallow or enforce spaces inside of curly braces in objects.
  116. object-curly-spacing:
  117. - 2
  118. - always
  119. # Disallow or enforce spaces inside of brackets.
  120. array-bracket-spacing:
  121. - 2
  122. - never
  123. # Disallow or enforce spaces inside of computed properties.
  124. computed-property-spacing:
  125. - 2
  126. - never