.eslintrc.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. ],
  16. plugins: ['@typescript-eslint', 'node', 'security'],
  17. parserOptions: {
  18. tsconfigRootDir: __dirname,
  19. project: './tsconfig.json'
  20. },
  21. globals: {
  22. __statics: true,
  23. process: true
  24. },
  25. // add your custom rules here
  26. rules: {
  27. // allow console.log during development only
  28. 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  29. // allow debugger during development only
  30. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  31. 'no-process-exit': 'off',
  32. 'security/detect-non-literal-fs-filename': 'warn',
  33. 'security/detect-unsafe-regex': 'error',
  34. 'security/detect-buffer-noassert': 'error',
  35. 'security/detect-child-process': 'warn',
  36. 'security/detect-disable-mustache-escape': 'error',
  37. 'security/detect-eval-with-expression': 'error',
  38. 'security/detect-no-csrf-before-method-override': 'error',
  39. 'security/detect-non-literal-regexp': 'error',
  40. 'security/detect-non-literal-require': 'warn',
  41. 'security/detect-object-injection': 'warn',
  42. 'security/detect-possible-timing-attacks': 'error',
  43. 'security/detect-pseudoRandomBytes': 'error',
  44. 'space-before-function-paren': 'off',
  45. '@typescript-eslint/default-param-last': 'off',
  46. '@typescript-eslint/strict-boolean-expressions': 0,
  47. 'no-return-await': 'warn',
  48. '@typescript-eslint/return-await': 'off'
  49. }
  50. }