.eslintrc 2.7 KB

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