.eslintrc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {
  2. "extends": [
  3. "standard",
  4. "prettier",
  5. "prettier/standard"
  6. ],
  7. "parserOptions": {
  8. "ecmaVersion": 2018
  9. },
  10. "plugins": [
  11. "mocha",
  12. "chai-expect",
  13. "chai-friendly"
  14. ],
  15. "env": {
  16. "node": true,
  17. "mocha": true
  18. },
  19. "rules": {
  20. "no-unused-expressions": 0,
  21. "chai-friendly/no-unused-expressions": "error",
  22. "no-console": "error"
  23. },
  24. "overrides": [
  25. {
  26. // Test specific rules
  27. "files": ["test/**/*.js"],
  28. "globals": {
  29. "expect": true
  30. },
  31. "rules": {
  32. // mocha-specific rules
  33. "mocha/handle-done-callback": "error",
  34. "mocha/no-exclusive-tests": "error",
  35. "mocha/no-global-tests": "error",
  36. "mocha/no-identical-title": "error",
  37. "mocha/no-nested-tests": "error",
  38. "mocha/no-pending-tests": "error",
  39. "mocha/no-skipped-tests": "error",
  40. "mocha/no-mocha-arrows": "error",
  41. // chai-specific rules
  42. "chai-expect/missing-assertion": "error",
  43. "chai-expect/terminating-properties": "error",
  44. // prefer-arrow-callback applies to all callbacks, not just ones in mocha tests.
  45. // we don't enforce this at the top-level - just in tests to manage `this` scope
  46. // based on mocha's context mechanism
  47. "mocha/prefer-arrow-callback": "error"
  48. }
  49. }
  50. ]
  51. }