项目原始demo,不改动
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
To repozytorium jest zarchiwizowane. Możesz wyświetlać pliki i je sklonować, ale nie możesz do niego przepychać zmian lub otwierać zgłoszeń/Pull Requestów.
 
 
 
 

37 wiersze
1.0 KiB

  1. /**
  2. * @fileoverview Disallow the use of process.exit()
  3. * @author Nicholas C. Zakas
  4. */
  5. "use strict";
  6. //------------------------------------------------------------------------------
  7. // Rule Definition
  8. //------------------------------------------------------------------------------
  9. module.exports = {
  10. meta: {
  11. docs: {
  12. description: "disallow the use of `process.exit()`",
  13. category: "Node.js and CommonJS",
  14. recommended: false,
  15. url: "https://eslint.org/docs/rules/no-process-exit"
  16. },
  17. schema: []
  18. },
  19. create(context) {
  20. //--------------------------------------------------------------------------
  21. // Public
  22. //--------------------------------------------------------------------------
  23. return {
  24. "CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(node) {
  25. context.report({ node: node.parent, message: "Don't use process.exit(); throw an error instead." });
  26. }
  27. };
  28. }
  29. };