.eslintrc.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module.exports = {
  2. env: {
  3. node: true,
  4. jest: true
  5. },
  6. extends: [
  7. 'standard',
  8. 'plugin:lodash-template/recommended',
  9. 'plugin:node/recommended'
  10. ],
  11. 'parserOptions': {
  12. 'ecmaVersion': 2020
  13. },
  14. 'plugins': [
  15. 'node',
  16. 'security'
  17. ],
  18. globals: {
  19. __statics: true,
  20. process: true
  21. },
  22. // add your custom rules here
  23. rules: {
  24. // allow console.log during development only
  25. 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  26. // allow debugger during development only
  27. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  28. 'no-process-exit': 'off',
  29. 'security/detect-non-literal-fs-filename': 'warn',
  30. 'security/detect-unsafe-regex': 'error',
  31. 'security/detect-buffer-noassert': 'error',
  32. 'security/detect-child-process': 'warn',
  33. 'security/detect-disable-mustache-escape': 'error',
  34. 'security/detect-eval-with-expression': 'error',
  35. 'security/detect-no-csrf-before-method-override': 'error',
  36. 'security/detect-non-literal-regexp': 'error',
  37. 'security/detect-non-literal-require': 'warn',
  38. 'security/detect-object-injection': 'warn',
  39. 'security/detect-possible-timing-attacks': 'error',
  40. 'security/detect-pseudoRandomBytes': 'error'
  41. }
  42. }