.eslintrc 1.2 KB

12345678910111213141516171819202122232425262728
  1. {
  2. "rules": {
  3. "curly": ["error", "multi-line"],
  4. "eol-last": ["error"],
  5. "indent": ["error", 2, {"SwitchCase": 1}], # Blockly/Google use 2-space indents
  6. "linebreak-style": ["error", "unix"],
  7. "max-len": ["error", 120, 4],
  8. "no-trailing-spaces": ["error", { "skipBlankLines": true }],
  9. "no-unused-vars": ["error", {"args": "after-used", "varsIgnorePattern": "^_"}],
  10. "no-use-before-define": ["error"],
  11. "quotes": ["off"], # Blockly mixes single and double quotes
  12. "semi": ["error", "always"],
  13. "space-before-function-paren": ["error", "never"], # Blockly doesn't have space before function paren
  14. "strict": ["off"], # Blockly uses 'use strict' in files
  15. "no-cond-assign": ["off"], # Blockly often uses cond-assignment in loops
  16. "no-redeclare": ["off"], # Closure style allows redeclarations
  17. "valid-jsdoc": ["error", {"requireReturn": false}],
  18. "no-console": ["off"]
  19. },
  20. "env": {
  21. "browser": true
  22. },
  23. "globals": {
  24. "Blockly": true, # Blockly global
  25. "goog": true # goog closure libraries/includes
  26. },
  27. "extends": "eslint:recommended"
  28. }