pipeline-operator-errors.js 2.1 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = exports.UnparenthesizedPipeBodyDescriptions = void 0;
  6. var _toNodeDescription = require("./to-node-description");
  7. const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
  8. exports.UnparenthesizedPipeBodyDescriptions = UnparenthesizedPipeBodyDescriptions;
  9. var _default = {
  10. PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
  11. PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
  12. PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
  13. PipeTopicUnconfiguredToken: ({
  14. token
  15. }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
  16. PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
  17. PipeUnparenthesizedBody: ({
  18. type
  19. }) => `Hack-style pipe body cannot be an unparenthesized ${(0, _toNodeDescription.default)({
  20. type
  21. })}; please wrap it in parentheses.`,
  22. PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
  23. PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
  24. PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
  25. PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
  26. PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
  27. PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
  28. };
  29. exports.default = _default;
  30. //# sourceMappingURL=pipeline-operator-errors.js.map