.eslintrc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // this file was auto-generated, do not edit it directly.
  2. // instead run bin/update_build_scripts from
  3. // https://github.com/sharelatex/sharelatex-dev-environment
  4. {
  5. "extends": [
  6. "standard",
  7. "prettier",
  8. "prettier/standard"
  9. ],
  10. "parserOptions": {
  11. "ecmaVersion": 2018
  12. },
  13. "plugins": [
  14. "mocha",
  15. "chai-expect",
  16. "chai-friendly"
  17. ],
  18. "env": {
  19. "node": true,
  20. "mocha": true
  21. },
  22. "rules": {
  23. // Swap the no-unused-expressions rule with a more chai-friendly one
  24. "no-unused-expressions": 0,
  25. "chai-friendly/no-unused-expressions": "error"
  26. },
  27. "overrides": [
  28. {
  29. // Test specific rules
  30. "files": ["test/**/*.js"],
  31. "globals": {
  32. "expect": true
  33. },
  34. "rules": {
  35. // mocha-specific rules
  36. "mocha/handle-done-callback": "error",
  37. "mocha/no-exclusive-tests": "error",
  38. "mocha/no-global-tests": "error",
  39. "mocha/no-identical-title": "error",
  40. "mocha/no-nested-tests": "error",
  41. "mocha/no-pending-tests": "error",
  42. "mocha/no-skipped-tests": "error",
  43. "mocha/no-mocha-arrows": "error",
  44. // chai-specific rules
  45. "chai-expect/missing-assertion": "error",
  46. "chai-expect/terminating-properties": "error",
  47. // prefer-arrow-callback applies to all callbacks, not just ones in mocha tests.
  48. // we don't enforce this at the top-level - just in tests to manage `this` scope
  49. // based on mocha's context mechanism
  50. "mocha/prefer-arrow-callback": "error"
  51. }
  52. },
  53. {
  54. // Backend specific rules
  55. "files": ["app/**/*.js", "app.js", "index.js"],
  56. "rules": {
  57. // don't allow console.log in backend code
  58. "no-console": "error"
  59. }
  60. }
  61. ]
  62. }