.eslintrc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {
  2. "env": {
  3. "browser": true,
  4. "es6": true
  5. },
  6. "parserOptions": {
  7. "sourceType": "module"
  8. },
  9. "extends": "eslint:recommended",
  10. "rules": {
  11. // Unsafe or confusing stuff that we forbid
  12. "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
  13. "no-constant-condition": ["error", { "checkLoops": false }],
  14. "no-var": "error",
  15. "no-useless-constructor": "error",
  16. "object-shorthand": ["error", "methods", { "avoidQuotes": true }],
  17. "prefer-arrow-callback": "error",
  18. "arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": false } ],
  19. "arrow-parens": ["error", "as-needed", { "requireForBlockBody": true }],
  20. "arrow-spacing": ["error"],
  21. "no-confusing-arrow": ["error", { "allowParens": true }],
  22. // Enforced coding style
  23. "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
  24. "indent": ["error", 4, { "SwitchCase": 1,
  25. "FunctionDeclaration": { "parameters": "first" },
  26. "CallExpression": { "arguments": "first" },
  27. "ArrayExpression": "first",
  28. "ObjectExpression": "first",
  29. "ignoreComments": true }],
  30. "comma-spacing": ["error"],
  31. "comma-style": ["error"],
  32. "curly": ["error", "multi-line"],
  33. "func-call-spacing": ["error"],
  34. "func-names": ["error"],
  35. "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
  36. "key-spacing": ["error"],
  37. "keyword-spacing": ["error"],
  38. "no-trailing-spaces": ["error"],
  39. "semi": ["error"],
  40. "space-before-blocks": ["error"],
  41. "space-before-function-paren": ["error", { "anonymous": "always",
  42. "named": "never",
  43. "asyncArrow": "always" }],
  44. "switch-colon-spacing": ["error"],
  45. "camelcase": ["error", { allow: ["^XK_", "^XF86XK_"] }],
  46. }
  47. }