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