node.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module.exports = {
  2. env: {
  3. node: true
  4. },
  5. rules: {
  6. // enforce return after a callback
  7. 'callback-return': 'off',
  8. // require all requires be top-level
  9. // https://eslint.org/docs/rules/global-require
  10. 'global-require': 'error',
  11. // enforces error handling in callbacks (node environment)
  12. 'handle-callback-err': 'off',
  13. // disallow use of the Buffer() constructor
  14. // https://eslint.org/docs/rules/no-buffer-constructor
  15. 'no-buffer-constructor': 'error',
  16. // disallow mixing regular variable and require declarations
  17. 'no-mixed-requires': ['off', false],
  18. // disallow use of new operator with the require function
  19. 'no-new-require': 'error',
  20. // disallow string concatenation with __dirname and __filename
  21. // https://eslint.org/docs/rules/no-path-concat
  22. 'no-path-concat': 'error',
  23. // disallow use of process.env
  24. 'no-process-env': 'off',
  25. // disallow process.exit()
  26. 'no-process-exit': 'off',
  27. // restrict usage of specified node modules
  28. 'no-restricted-modules': 'off',
  29. // disallow use of synchronous methods (off by default)
  30. 'no-sync': 'off',
  31. }
  32. };