项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Deze repo is gearchiveerd. U kunt bestanden bekijken en het klonen, maar niet pushen of problemen/pull-requests openen.
 
 
 
 

41 regels
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. };