.eslintrc.json 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {
  2. "extends": "eslint:recommended",
  3. "env": {
  4. "browser": true,
  5. "es6": true,
  6. "node": true
  7. },
  8. "globals": {
  9. "Drupal": true,
  10. "drupalSettings": true,
  11. "drupalTranslations": true,
  12. "domready": true,
  13. "jQuery": true,
  14. "_": true,
  15. "matchMedia": true,
  16. "Backbone": true,
  17. "Modernizr": true,
  18. "CKEDITOR": true
  19. },
  20. "rules": {
  21. // Errors.
  22. "array-bracket-spacing": [2, "never"],
  23. "block-scoped-var": 2,
  24. "brace-style": [2, "stroustrup", {"allowSingleLine": true}],
  25. "comma-dangle": [2, "never"],
  26. "comma-spacing": 2,
  27. "comma-style": [2, "last"],
  28. "computed-property-spacing": [2, "never"],
  29. "curly": [2, "all"],
  30. "eol-last": 2,
  31. "eqeqeq": [2, "smart"],
  32. "guard-for-in": 2,
  33. "indent": [2, 2, {"SwitchCase": 1}],
  34. "key-spacing": [2, {"beforeColon": false, "afterColon": true}],
  35. "keyword-spacing": [2, {"before": true, "after": true}],
  36. "linebreak-style": [2, "unix"],
  37. "lines-around-comment": [2, {"beforeBlockComment": true, "afterBlockComment": false}],
  38. "new-parens": 2,
  39. "no-array-constructor": 2,
  40. "no-caller": 2,
  41. "no-catch-shadow": 2,
  42. "no-eval": 2,
  43. "no-extend-native": 2,
  44. "no-extra-bind": 2,
  45. "no-extra-parens": [2, "functions"],
  46. "no-implied-eval": 2,
  47. "no-iterator": 2,
  48. "no-label-var": 2,
  49. "no-labels": 2,
  50. "no-lone-blocks": 2,
  51. "no-loop-func": 2,
  52. "no-multi-spaces": 2,
  53. "no-multi-str": 2,
  54. "no-native-reassign": 2,
  55. "no-nested-ternary": 2,
  56. "no-new-func": 2,
  57. "no-new-object": 2,
  58. "no-new-wrappers": 2,
  59. "no-octal-escape": 2,
  60. "no-process-exit": 2,
  61. "no-proto": 2,
  62. "no-return-assign": 2,
  63. "no-script-url": 2,
  64. "no-sequences": 2,
  65. "no-shadow-restricted-names": 2,
  66. "no-spaced-func": 2,
  67. "no-trailing-spaces": 2,
  68. "no-undef-init": 2,
  69. "no-undefined": 2,
  70. "no-unused-expressions": 2,
  71. "no-unused-vars": [2, {"vars": "all", "args": "none"}],
  72. "no-with": 2,
  73. "object-curly-spacing": [2, "never"],
  74. "one-var": [2, "never"],
  75. "quote-props": [2, "consistent-as-needed"],
  76. "quotes": [2, "single", "avoid-escape"],
  77. "semi": [2, "always"],
  78. "semi-spacing": [2, {"before": false, "after": true}],
  79. "space-before-blocks": [2, "always"],
  80. "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
  81. "space-in-parens": [2, "never"],
  82. "space-infix-ops": 2,
  83. "space-unary-ops": [2, { "words": true, "nonwords": false }],
  84. "spaced-comment": [2, "always"],
  85. "strict": [2, "function"],
  86. "yoda": [2, "never"],
  87. // Warnings.
  88. "max-nested-callbacks": [1, 3],
  89. "valid-jsdoc": [1, {
  90. "prefer": {
  91. "returns": "return",
  92. "property": "prop"
  93. },
  94. "requireReturn": false
  95. }]
  96. }
  97. }