UNPKG

12.4 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.ErrorMessages = void 0;
7const ErrorMessages = Object.freeze({
8 AccessorIsGenerator: "A %0ter cannot be a generator",
9 ArgumentsInClass: "'arguments' is only allowed in functions and class methods",
10 AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block",
11 AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function",
12 AwaitExpressionFormalParameter: "await is not allowed in async function parameters",
13 AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules",
14 AwaitNotInAsyncFunction: "'await' is only allowed within async functions",
15 BadGetterArity: "getter must not have any formal parameters",
16 BadSetterArity: "setter must have exactly one formal parameter",
17 BadSetterRestParameter: "setter function argument must not be a rest parameter",
18 ConstructorClassField: "Classes may not have a field named 'constructor'",
19 ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'",
20 ConstructorIsAccessor: "Class constructor may not be an accessor",
21 ConstructorIsAsync: "Constructor can't be an async function",
22 ConstructorIsGenerator: "Constructor can't be a generator",
23 DeclarationMissingInitializer: "%0 require an initialization value",
24 DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax",
25 DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
26 DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.",
27 DecoratorSemicolon: "Decorators must not be followed by a semicolon",
28 DecoratorStaticBlock: "Decorators can't be used with a static block",
29 DeletePrivateField: "Deleting a private field is not allowed",
30 DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
31 DuplicateConstructor: "Duplicate constructor in the same class",
32 DuplicateDefaultExport: "Only one default export allowed per module.",
33 DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.",
34 DuplicateProto: "Redefinition of __proto__ property",
35 DuplicateRegExpFlags: "Duplicate regular expression flag",
36 DuplicateStaticBlock: "Duplicate static block in the same class",
37 ElementAfterRest: "Rest element must be last element",
38 EscapedCharNotAnIdentifier: "Invalid Unicode escape",
39 ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { %0 as '%1' } from 'some-module'`?",
40 ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'",
41 ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer",
42 GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block",
43 IllegalBreakContinue: "Unsyntactic %0",
44 IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list",
45 IllegalReturn: "'return' outside of function",
46 ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?',
47 ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments",
48 ImportCallArity: "import() requires exactly %0",
49 ImportCallNotNewExpression: "Cannot use new with import(...)",
50 ImportCallSpreadArgument: "... is not allowed in import()",
51 ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
52 ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`,
53 InvalidBigIntLiteral: "Invalid BigIntLiteral",
54 InvalidCodePoint: "Code point out of bounds",
55 InvalidDecimal: "Invalid decimal",
56 InvalidDigit: "Expected number in radix %0",
57 InvalidEscapeSequence: "Bad character escape sequence",
58 InvalidEscapeSequenceTemplate: "Invalid escape sequence in template",
59 InvalidEscapedReservedWord: "Escape sequence in keyword %0",
60 InvalidIdentifier: "Invalid identifier %0",
61 InvalidLhs: "Invalid left-hand side in %0",
62 InvalidLhsBinding: "Binding invalid left-hand side in %0",
63 InvalidNumber: "Invalid number",
64 InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'",
65 InvalidOrUnexpectedToken: "Unexpected character '%0'",
66 InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern",
67 InvalidPrivateFieldResolution: "Private name #%0 is not defined",
68 InvalidPropertyBindingPattern: "Binding member expression",
69 InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions",
70 InvalidRestAssignmentPattern: "Invalid rest operator's argument",
71 LabelRedeclaration: "Label '%0' is already declared",
72 LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
73 LineTerminatorBeforeArrow: "No line break is allowed before '=>'",
74 MalformedRegExpFlags: "Invalid regular expression flag",
75 MissingClassName: "A class name is required",
76 MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
77 MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX",
78 MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators",
79 ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`",
80 ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values",
81 ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes',
82 ModuleExportNameHasLoneSurrogate: "An export name cannot include a lone surrogate, found '\\u%0'",
83 ModuleExportUndefined: "Export '%0' is not defined",
84 MultipleDefaultsInSwitch: "Multiple default clauses",
85 NewlineAfterThrow: "Illegal newline after throw",
86 NoCatchOrFinally: "Missing catch or finally clause",
87 NumberIdentifier: "Identifier directly after number",
88 NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences",
89 ObsoleteAwaitStar: "await* has been removed from the async functions proposal. Use Promise.all() instead.",
90 OptionalChainingNoNew: "constructors in/after an Optional Chain are not allowed",
91 OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain",
92 ParamDupe: "Argument name clash",
93 PatternHasAccessor: "Object pattern can't contain getter or setter",
94 PatternHasMethod: "Object pattern can't contain methods",
95 PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized',
96 PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression",
97 PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression",
98 PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference",
99 PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding",
100 PrimaryTopicRequiresSmartPipeline: "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.",
101 PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)",
102 PrivateNameRedeclaration: "Duplicate private name #%0",
103 RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
104 RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
105 RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
106 RecordNoProto: "'__proto__' is not allowed in Record expressions",
107 RestTrailingComma: "Unexpected trailing comma after rest element",
108 SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",
109 StaticPrototype: "Classes may not have static property named prototype",
110 StrictDelete: "Deleting local variable in strict mode",
111 StrictEvalArguments: "Assigning to '%0' in strict mode",
112 StrictEvalArgumentsBinding: "Binding '%0' in strict mode",
113 StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block",
114 StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'",
115 StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode",
116 StrictWith: "'with' in strict mode",
117 SuperNotAllowed: "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
118 SuperPrivateField: "Private fields can't be accessed on super",
119 TrailingDecorator: "Decorators must be attached to a class element",
120 TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
121 TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
122 TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
123 UnexpectedArgumentPlaceholder: "Unexpected argument placeholder",
124 UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal',
125 UnexpectedDigitAfterHash: "Unexpected digit after hash token",
126 UnexpectedImportExport: "'import' and 'export' may only appear at the top level",
127 UnexpectedKeyword: "Unexpected keyword '%0'",
128 UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration",
129 UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context",
130 UnexpectedNewTarget: "new.target can only be used in functions",
131 UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits",
132 UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).",
133 UnexpectedReservedWord: "Unexpected reserved word '%0'",
134 UnexpectedSuper: "super is only allowed in object methods and classes",
135 UnexpectedToken: "Unexpected token '%0'",
136 UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
137 UnsupportedBind: "Binding should be performed on object property.",
138 UnsupportedDecoratorExport: "A decorated export must export a class declaration",
139 UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
140 UnsupportedImport: "import can only be used in import() or import.meta",
141 UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1",
142 UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters",
143 UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties",
144 UnsupportedSuper: "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])",
145 UnterminatedComment: "Unterminated comment",
146 UnterminatedRegExp: "Unterminated regular expression",
147 UnterminatedString: "Unterminated string constant",
148 UnterminatedTemplate: "Unterminated template",
149 VarRedeclaration: "Identifier '%0' has already been declared",
150 YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator",
151 YieldInParameter: "Yield expression is not allowed in formal parameters",
152 ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0"
153});
154exports.ErrorMessages = ErrorMessages;
\No newline at end of file