mirror of https://github.com/sveltejs/svelte
parent
45f375a5eb
commit
0c40cc5937
@ -0,0 +1,51 @@
|
||||
## empty_attribute_shorthand
|
||||
|
||||
Attribute shorthand cannot be empty
|
||||
|
||||
## duplicate_attribute
|
||||
|
||||
Attributes need to be unique
|
||||
|
||||
## invalid_event_attribute_value
|
||||
|
||||
Event attribute must be a JavaScript expression, not a string
|
||||
|
||||
## invalid_attribute_name
|
||||
|
||||
'%name%' is not a valid attribute name
|
||||
|
||||
## invalid_animation
|
||||
|
||||
An element that uses the animate directive must be the immediate child of a keyed each block`
|
||||
: type === 'each-key'
|
||||
? `An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?`
|
||||
: `An element that uses the animate directive must be the sole child of a keyed each block
|
||||
|
||||
## duplicate_animation
|
||||
|
||||
An element can only have one 'animate' directive
|
||||
|
||||
## invalid_event_modifier
|
||||
|
||||
Valid event modifiers are %modifiers.slice(0, -1).join(', ')% or %modifiers.slice(-1)%`
|
||||
: `Event modifiers other than 'once' can only be used on DOM elements
|
||||
|
||||
## invalid_event_modifier_combination
|
||||
|
||||
The '%modifier1%' and '%modifier2%' modifiers cannot be used together
|
||||
|
||||
## duplicate_transition
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_let_directive_placement
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_style_directive_modifier
|
||||
|
||||
Invalid 'style:' modifier. Valid modifiers are: 'important'
|
||||
|
||||
## invalid_sequence_expression
|
||||
|
||||
Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses
|
||||
@ -0,0 +1,27 @@
|
||||
## invalid_binding_expression
|
||||
|
||||
Can only bind to an Identifier or MemberExpression
|
||||
|
||||
## invalid_binding_value
|
||||
|
||||
Can only bind to state or props
|
||||
|
||||
## invalid_binding
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_type_attribute
|
||||
|
||||
'type' attribute must be a static text value if input uses two-way binding
|
||||
|
||||
## invalid_multiple_attribute
|
||||
|
||||
'multiple' attribute must be static if select uses two-way binding
|
||||
|
||||
## missing_contenteditable_attribute
|
||||
|
||||
'contenteditable' attribute is required for textContent, innerHTML and innerText two-way bindings
|
||||
|
||||
## dynamic_contenteditable_attribute
|
||||
|
||||
'contenteditable' attribute cannot be dynamic if element uses two-way binding
|
||||
@ -0,0 +1,7 @@
|
||||
## invalid_compiler_option
|
||||
|
||||
Invalid compiler option: %msg%
|
||||
|
||||
## removed_compiler_option
|
||||
|
||||
Invalid compiler option: %msg%
|
||||
@ -0,0 +1,3 @@
|
||||
## invalid_component_directive
|
||||
|
||||
This type of directive is not valid on components
|
||||
@ -0,0 +1,3 @@
|
||||
## invalid_const_placement
|
||||
|
||||
{@const} must be the immediate child of {#snippet}, {#if}, {:else if}, {:else}, {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>
|
||||
@ -0,0 +1,55 @@
|
||||
## css_parse_error
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_css_empty_declaration
|
||||
|
||||
Declaration cannot be empty
|
||||
|
||||
## invalid_css_global_block_list
|
||||
|
||||
A :global {...} block cannot be part of a selector list with more than one item
|
||||
|
||||
## invalid_css_global_block_modifier
|
||||
|
||||
A :global {...} block cannot modify an existing selector
|
||||
|
||||
## invalid_css_global_block_combinator
|
||||
|
||||
A :global {...} block cannot follow a %name% combinator
|
||||
|
||||
## invalid_css_global_block_declaration
|
||||
|
||||
A :global {...} block can only contain rules, not declarations
|
||||
|
||||
## invalid_css_global_placement
|
||||
|
||||
:global(...) can be at the start or end of a selector sequence, but not in the middle
|
||||
|
||||
## invalid_css_global_selector
|
||||
|
||||
:global(...) must contain exactly one selector
|
||||
|
||||
## invalid_css_global_selector_list
|
||||
|
||||
:global(...) must not contain type or universal selectors when used in a compound selector
|
||||
|
||||
## invalid_css_type_selector_placement
|
||||
|
||||
:global(...) must not be followed with a type selector
|
||||
|
||||
## invalid_css_selector
|
||||
|
||||
Invalid selector
|
||||
|
||||
## invalid_css_identifier
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_nesting_selector
|
||||
|
||||
Nesting selectors can only be used inside a rule
|
||||
|
||||
## invalid_css_declaration
|
||||
|
||||
TODO
|
||||
@ -0,0 +1,27 @@
|
||||
## invalid_textarea_content
|
||||
|
||||
A <textarea> can have either a value attribute or (equivalently) child content, but not both
|
||||
|
||||
## invalid_void_content
|
||||
|
||||
Void elements cannot have children or closing tags
|
||||
|
||||
## invalid_element_content
|
||||
|
||||
<%name%> cannot have children
|
||||
|
||||
## invalid_tag_name
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_node_placement
|
||||
|
||||
%thing% is invalid inside <%parent%>
|
||||
|
||||
## illegal_title_attribute
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_title_content
|
||||
|
||||
TODO
|
||||
@ -0,0 +1,3 @@
|
||||
## cyclical_reactive_declaration
|
||||
|
||||
Cyclical dependency detected: %cycle.join(' → ')%
|
||||
@ -1,7 +1,147 @@
|
||||
## unclosed_element
|
||||
|
||||
%element% was left open
|
||||
<%name%> was left open
|
||||
|
||||
## unclosed_block
|
||||
|
||||
Block was left open
|
||||
|
||||
## unexpected_block_close
|
||||
|
||||
Unexpected block closing tag
|
||||
|
||||
## unexpected_eof
|
||||
|
||||
TODO
|
||||
|
||||
## js_parse_error
|
||||
|
||||
TODO
|
||||
|
||||
## expected_token
|
||||
|
||||
Expected token %token%
|
||||
|
||||
## unexpected_reserved_word
|
||||
|
||||
'%word%' is a reserved word in JavaScript and cannot be used here
|
||||
|
||||
## missing_whitespace
|
||||
|
||||
Expected whitespace
|
||||
|
||||
## expected_pattern
|
||||
|
||||
Expected identifier or destructure pattern
|
||||
|
||||
## invalid_script_context
|
||||
|
||||
If the context attribute is supplied, its value must be "module"
|
||||
|
||||
## invalid_elseif
|
||||
|
||||
'elseif' should be 'else if'
|
||||
|
||||
## invalid_continuing_block_placement
|
||||
|
||||
{:...} block is invalid at this position (did you forget to close the preceeding element or block?)
|
||||
|
||||
## invalid_block_missing_parent
|
||||
|
||||
%child% block must be a child of %parent%
|
||||
|
||||
## duplicate_block_part
|
||||
|
||||
%name% cannot appear more than once within a block
|
||||
|
||||
## expected_block_type
|
||||
|
||||
Expected 'if', 'each', 'await', 'key' or 'snippet'
|
||||
|
||||
## expected_identifier
|
||||
|
||||
Expected an identifier
|
||||
|
||||
## invalid_debug
|
||||
|
||||
{@debug ...} arguments must be identifiers, not arbitrary expressions
|
||||
|
||||
## invalid_const
|
||||
|
||||
{@const ...} must be an assignment
|
||||
|
||||
## invalid_block_placement
|
||||
|
||||
{#%name% ...} block cannot be %location%
|
||||
|
||||
## invalid_tag_placement
|
||||
|
||||
{@%name% ...} tag cannot be %location%
|
||||
|
||||
## missing_attribute_value
|
||||
|
||||
Expected attribute value
|
||||
|
||||
## unclosed_attribute_value
|
||||
|
||||
Expected closing %delimiter% character
|
||||
|
||||
## invalid_directive_value
|
||||
|
||||
Directive value must be a JavaScript expression enclosed in curly braces
|
||||
|
||||
## empty_directive_name
|
||||
|
||||
%type% name cannot be empty
|
||||
|
||||
## invalid_closing_tag
|
||||
|
||||
</%name%> attempted to close an element that was not open
|
||||
|
||||
## invalid_closing_tag_after_autoclose
|
||||
|
||||
</%name%> attempted to close element that was already automatically closed by <%reason%> (cannot nest <%reason%> inside <%name%>)
|
||||
|
||||
## invalid_dollar_binding
|
||||
|
||||
The $ name is reserved, and cannot be used for variables and imports
|
||||
|
||||
## invalid_dollar_prefix
|
||||
|
||||
The $ prefix is reserved, and cannot be used for variables and imports
|
||||
|
||||
## invalid_dollar_global
|
||||
|
||||
The $ name is reserved. To reference a global variable called $, use globalThis.$
|
||||
|
||||
## illegal_subscription
|
||||
|
||||
Cannot reference store value inside <script context="module">
|
||||
|
||||
## duplicate_style_element
|
||||
|
||||
A component can have a single top-level <style> element
|
||||
|
||||
## duplicate_script_element
|
||||
|
||||
A component can have a single top-level <script> element and/or a single top-level <script context="module"> element
|
||||
|
||||
## invalid_render_expression
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_render_arguments
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_render_call
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_render_spread_argument
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_snippet_rest_parameter
|
||||
|
||||
TODO
|
||||
@ -0,0 +1,101 @@
|
||||
## invalid_legacy_props
|
||||
|
||||
Cannot use $$props in runes mode
|
||||
|
||||
## invalid_legacy_rest_props
|
||||
|
||||
Cannot use $$restProps in runes mode
|
||||
|
||||
## invalid_legacy_reactive_statement
|
||||
|
||||
$: is not allowed in runes mode, use $derived or $effect instead
|
||||
|
||||
## invalid_legacy_export
|
||||
|
||||
Cannot use \`export let\` in runes mode — use $props instead
|
||||
|
||||
## invalid_rune_usage
|
||||
|
||||
Cannot use %rune% rune in non-runes mode
|
||||
|
||||
## invalid_state_export
|
||||
|
||||
Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties
|
||||
|
||||
## invalid_derived_export
|
||||
|
||||
Cannot export derived state from a module. To expose the current derived value, export a function returning its value
|
||||
|
||||
## invalid_props_id
|
||||
|
||||
$props() can only be used with an object destructuring pattern
|
||||
|
||||
## invalid_props_pattern
|
||||
|
||||
$props() assignment must not contain nested properties or computed keys
|
||||
|
||||
## invalid_props_location
|
||||
|
||||
$props() can only be used at the top level of components as a variable declaration initializer
|
||||
|
||||
## invalid_bindable_location
|
||||
|
||||
$bindable() can only be used inside a $props() declaration
|
||||
|
||||
## invalid_state_location
|
||||
|
||||
%rune%(...) can only be used as a variable declaration initializer or a class field
|
||||
|
||||
## invalid_effect_location
|
||||
|
||||
$effect() can only be used as an expression statement
|
||||
|
||||
## invalid_host_location
|
||||
|
||||
$host() can only be used inside custom element component instances
|
||||
|
||||
## invalid_const_assignment
|
||||
|
||||
Invalid %is_binding ? 'binding' : 'assignment'% to const variable%
|
||||
show_details
|
||||
? ' ($derived values, let: directives, :then/:catch variables and @const declarations count as const)'
|
||||
: ''
|
||||
%
|
||||
|
||||
## invalid_derived_assignment
|
||||
|
||||
Invalid assignment to derived state
|
||||
|
||||
## invalid_derived_binding
|
||||
|
||||
Invalid binding to derived state
|
||||
|
||||
## invalid_rune_args_length
|
||||
|
||||
%rune% can only be called with %list(args, 'or')% %
|
||||
args.length === 1 && args[0] === 1 ? 'argument' : 'arguments'
|
||||
%
|
||||
|
||||
## invalid_runes_mode_import
|
||||
|
||||
%name% cannot be used in runes mode
|
||||
|
||||
## duplicate_props_rune
|
||||
|
||||
Cannot use $props() more than once
|
||||
|
||||
## invalid_each_assignment
|
||||
|
||||
Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. 'array[i] = value' instead of 'entry = value')
|
||||
|
||||
## invalid_snippet_assignment
|
||||
|
||||
Cannot reassign or bind to snippet parameter
|
||||
|
||||
## invalid_derived_call
|
||||
|
||||
$derived.call(...) has been replaced with $derived.by(...)
|
||||
|
||||
## conflicting_property_name
|
||||
|
||||
Cannot have a property and a component export with the same name
|
||||
@ -0,0 +1,28 @@
|
||||
## invalid_slot_element_attribute
|
||||
|
||||
<slot> can only receive attributes and (optionally) let directives
|
||||
|
||||
## invalid_slot_attribute
|
||||
|
||||
slot attribute must be a static value
|
||||
|
||||
## invalid_slot_name
|
||||
|
||||
default is a reserved word — it cannot be used as a slot name`
|
||||
: `slot attribute must be a static value
|
||||
|
||||
## invalid_slot_placement
|
||||
|
||||
Element with a slot='...' attribute must be a child of a component or a descendant of a custom element
|
||||
|
||||
## duplicate_slot_name
|
||||
|
||||
Duplicate slot name '%name%' in <%component%>
|
||||
|
||||
## invalid_default_slot_content
|
||||
|
||||
Found default slot content alongside an explicit slot="default"
|
||||
|
||||
## conflicting_children_snippet
|
||||
|
||||
Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block
|
||||
@ -0,0 +1,99 @@
|
||||
## invalid_svelte_option_attribute
|
||||
|
||||
<svelte:options> can only receive static attributes
|
||||
|
||||
## invalid_svelte_option_namespace
|
||||
|
||||
Unsupported <svelte:option> value for "namespace". Valid values are "html", "svg" or "foreign".
|
||||
|
||||
## tag_option_deprecated
|
||||
|
||||
"tag" option is deprecated — use "customElement" instead
|
||||
|
||||
## invalid_svelte_option_runes
|
||||
|
||||
Unsupported <svelte:option> value for "runes". Valid values are true or false.
|
||||
|
||||
## invalid_svelte_option_accessors
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_svelte_option_preserveWhitespace
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_svelte_option_immutable
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_tag_property
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_svelte_option_customElement
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_customElement_props_attribute
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_customElement_shadow_attribute
|
||||
|
||||
TODO
|
||||
|
||||
## unknown_svelte_option_attribute
|
||||
|
||||
<svelte:options> unknown attribute '%name%'
|
||||
|
||||
## illegal_svelte_head_attribute
|
||||
|
||||
TODO
|
||||
|
||||
## invalid_svelte_fragment_attribute
|
||||
|
||||
<svelte:fragment> can only have a slot attribute and (optionally) a let: directive
|
||||
|
||||
## invalid_svelte_fragment_slot
|
||||
|
||||
<svelte:fragment> slot attribute must have a static value
|
||||
|
||||
## invalid_svelte_fragment_placement
|
||||
|
||||
<svelte:fragment> must be the direct child of a component
|
||||
|
||||
## invalid_svelte_element_placement
|
||||
|
||||
<%name%> tags cannot be inside elements or blocks
|
||||
|
||||
## duplicate_svelte_element
|
||||
|
||||
A component can only have one <%name%> element
|
||||
|
||||
## invalid_self_placement
|
||||
|
||||
<svelte:self> components can only exist inside {#if} blocks, {#each} blocks, {#snippet} blocks or slots passed to components
|
||||
|
||||
## missing_svelte_element_definition
|
||||
|
||||
<svelte:element> must have a 'this' attribute
|
||||
|
||||
## missing_svelte_component_definition
|
||||
|
||||
<svelte:component> must have a 'this' attribute
|
||||
|
||||
## invalid_svelte_element_definition
|
||||
|
||||
Invalid element definition — must be an {expression}
|
||||
|
||||
## invalid_svelte_component_definition
|
||||
|
||||
Invalid component definition — must be an {expression}
|
||||
|
||||
## invalid_svelte_tag
|
||||
|
||||
Valid <svelte:...> tag names are %list(tags)%%match ? ' (did you mean ' + match + '?)' : ''%
|
||||
|
||||
## conflicting_slot_usage
|
||||
|
||||
Cannot use <slot> syntax and {@render ...} tags in the same component. Migrate towards {@render ...} tags completely.
|
||||
@ -0,0 +1,19 @@
|
||||
## illegal_global
|
||||
|
||||
%name% is an illegal variable name. To reference a global variable called %name%, use globalThis.%name%
|
||||
|
||||
## duplicate_declaration
|
||||
|
||||
'%name%' has already been declared
|
||||
|
||||
## default_export
|
||||
|
||||
A component cannot have a default export
|
||||
|
||||
## illegal_variable_declaration
|
||||
|
||||
TODO
|
||||
|
||||
## illegal_store_subscription
|
||||
|
||||
TODO
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue