.eslintrc.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true,
  5. jest: true
  6. },
  7. parser: '@typescript-eslint/parser',
  8. extends: [
  9. 'standard-with-typescript',
  10. 'plugin:@typescript-eslint/recommended-requiring-type-checking',
  11. 'plugin:lodash-template/recommended',
  12. // TODO: make this work with typescript
  13. // 'plugin:node/recommended'
  14. 'prettier',
  15. 'prettier/@typescript-eslint'
  16. ],
  17. plugins: ['@typescript-eslint', 'node', 'security'],
  18. parserOptions: {
  19. tsconfigRootDir: __dirname,
  20. project: './tsconfig.json'
  21. },
  22. globals: {
  23. __statics: true,
  24. process: true
  25. },
  26. // add your custom rules here
  27. rules: {
  28. // allow console.log during development only
  29. 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  30. // allow debugger during development only
  31. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  32. 'no-process-exit': 'off',
  33. 'security/detect-non-literal-fs-filename': 'warn',
  34. 'security/detect-unsafe-regex': 'error',
  35. 'security/detect-buffer-noassert': 'error',
  36. 'security/detect-child-process': 'warn',
  37. 'security/detect-disable-mustache-escape': 'error',
  38. 'security/detect-eval-with-expression': 'error',
  39. 'security/detect-no-csrf-before-method-override': 'error',
  40. 'security/detect-non-literal-regexp': 'error',
  41. 'security/detect-non-literal-require': 'warn',
  42. 'security/detect-object-injection': 'warn',
  43. 'security/detect-possible-timing-attacks': 'error',
  44. 'security/detect-pseudoRandomBytes': 'error',
  45. 'space-before-function-paren': 'off',
  46. '@typescript-eslint/default-param-last': 'off',
  47. '@typescript-eslint/strict-boolean-expressions': 0
  48. }
  49. }