.eslintrc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. "parser": "babel-eslint",
  3. "plugins": ["babel"],
  4. "env": {
  5. "node": true,
  6. "es6": true
  7. },
  8. "ecmaFeatures": {
  9. "arrowFunctions": true,
  10. "binaryLiterals": true,
  11. "blockBindings": true,
  12. "classes": true,
  13. "defaultParams": true,
  14. "destructuring": true,
  15. "forOf": true,
  16. "generators": true,
  17. "modules": true,
  18. "objectLiteralComputedProperties": true,
  19. "objectLiteralDuplicateProperties": true,
  20. "objectLiteralShorthandMethods": true,
  21. "objectLiteralShorthandProperties": true,
  22. "octalLiterals": true,
  23. "regexUFlag": true,
  24. "regexYFlag": true,
  25. "restParams": true,
  26. "spread": true,
  27. "superInFunctions": true,
  28. "templateStrings": true,
  29. "unicodeCodePointEscapes": true,
  30. "globalReturn": true,
  31. "experimentalObjectRestSpread": true
  32. },
  33. "rules": {
  34. ///
  35. /// Code style
  36. ///
  37. "indent": [2, 4, {"SwitchCase": 1}], // switch with indent
  38. "no-trailing-spaces": [2, { "skipBlankLines": true }],
  39. "eol-last": [2],
  40. "quotes": [2, "single"],
  41. "key-spacing": [2, {
  42. "beforeColon": false,
  43. "afterColon": true
  44. }],
  45. "linebreak-style": [2, "unix"],
  46. "no-new-object": [2],
  47. "no-unneeded-ternary": [2],
  48. "semi": [2, "always"],
  49. "semi-spacing": [2, {"before": false, "after": true}],
  50. "keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}],
  51. "space-before-function-paren": [2, "never"],
  52. "no-multiple-empty-lines": 0,
  53. "spaced-comment": [1, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
  54. "padded-blocks": [1, "never"],
  55. // enforces a space inside of curly braces
  56. "object-curly-spacing": [2, "always"],
  57. ///
  58. /// Best Practices
  59. ///
  60. "eqeqeq": [2, "smart"],
  61. // allow/warn the use of nested ternary expressions
  62. "no-nested-ternary": 1,
  63. ///
  64. /// eslint-plugin-babel
  65. ///
  66. "babel/generator-star-spacing": [1, {"before": false, "after": true}],
  67. "babel/new-cap": 1,
  68. "babel/object-curly-spacing": 0,
  69. "babel/object-shorthand": 1,
  70. // wont enforces the consistent use of parentheses in arrow functions
  71. "babel/arrow-parens": 0,
  72. "babel/no-await-in-loop": 1
  73. }
  74. }