项目原始demo,不改动
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.
 
 
 
 

41 Zeilen
1010 B

  1. /**
  2. * @fileoverview Disallow the use of process.env()
  3. * @author Vignesh Anand
  4. */
  5. "use strict";
  6. //------------------------------------------------------------------------------
  7. // Rule Definition
  8. //------------------------------------------------------------------------------
  9. module.exports = {
  10. meta: {
  11. docs: {
  12. description: "disallow the use of `process.env`",
  13. category: "Node.js and CommonJS",
  14. recommended: false,
  15. url: "https://eslint.org/docs/rules/no-process-env"
  16. },
  17. schema: []
  18. },
  19. create(context) {
  20. return {
  21. MemberExpression(node) {
  22. const objectName = node.object.name,
  23. propertyName = node.property.name;
  24. if (objectName === "process" && !node.computed && propertyName && propertyName === "env") {
  25. context.report({ node, message: "Unexpected use of process.env." });
  26. }
  27. }
  28. };
  29. }
  30. };