Skip to content

Commit 73490bb

Browse files
authored
chore: markdown errors (#11294)
* rename errors.js to errors-tmp.js * start porting errors * generate markdown files for more errors * convert parse errors * convert css errors * convert special_element errors * convert runes errors * convert element errors * more * more * more * more * more * more * fix some tests * fix some tests * more tests * remove unused error * prettierignore * weird * ugh * lint
1 parent 3866887 commit 73490bb

File tree

267 files changed

+3027
-1198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+3027
-1198
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ packages/**/dist/*.js
22
packages/**/build/*.js
33
packages/**/npm/**/*
44
packages/**/config/*.js
5+
packages/svelte/messages/**/*.md
6+
packages/svelte/src/compiler/errors.js
57
packages/svelte/tests/**/*.svelte
68
packages/svelte/tests/**/_expected*
79
packages/svelte/tests/**/_actual*

eslint.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ export default [
3333
ignores: [
3434
'**/*.d.ts',
3535
'**/tests',
36+
'packages/svelte/scripts/process-messages/templates/*.js',
37+
'packages/svelte/src/compiler/errors.js',
3638
'packages/svelte/compiler/index.js',
3739
// documentation can contain invalid examples
3840
'documentation',
3941
// contains a fork of the REPL which doesn't adhere to eslint rules
4042
'sites/svelte-5-preview/**',
4143
// wasn't checked previously, reenable at some point
42-
'sites/svelte.dev/**'
44+
'sites/svelte.dev/**',
45+
'tmp/**'
4346
]
4447
}
4548
];
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## empty_attribute_shorthand
2+
3+
Attribute shorthand cannot be empty
4+
5+
## duplicate_attribute
6+
7+
Attributes need to be unique
8+
9+
## invalid_event_attribute_value
10+
11+
Event attribute must be a JavaScript expression, not a string
12+
13+
## invalid_attribute_name
14+
15+
'%name%' is not a valid attribute name
16+
17+
## animation_invalid_placement
18+
19+
An element that uses the `animate:` directive must be the only child of a keyed `{#each ...}` block
20+
21+
## animation_missing_key
22+
23+
An element that uses the `animate:` directive must be the only child of a keyed `{#each ...}` block. Did you forget to add a key to your each block?
24+
25+
## animation_duplicate
26+
27+
An element can only have one 'animate' directive
28+
29+
## invalid_event_modifier
30+
31+
Valid event modifiers are %list%
32+
33+
## invalid_component_event_modifier
34+
35+
Event modifiers other than 'once' can only be used on DOM elements
36+
37+
## invalid_event_modifier_combination
38+
39+
The '%modifier1%' and '%modifier2%' modifiers cannot be used together
40+
41+
## transition_duplicate
42+
43+
Cannot use multiple `%type%:` directives on a single element
44+
45+
## transition_conflict
46+
47+
Cannot use `%type%:` alongside existing `%existing%:` directive
48+
49+
## invalid_let_directive_placement
50+
51+
`let:` directive at invalid position
52+
53+
## invalid_style_directive_modifier
54+
55+
Invalid 'style:' modifier. Valid modifiers are: 'important'
56+
57+
## invalid_sequence_expression
58+
59+
Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## invalid_binding_expression
2+
3+
Can only bind to an Identifier or MemberExpression
4+
5+
## invalid_binding_value
6+
7+
Can only bind to state or props
8+
9+
## bind_invalid_target
10+
11+
`bind:%name%` can only be used with %elements%
12+
13+
## bind_invalid
14+
15+
`bind:%name%` is not a valid binding
16+
17+
## bind_invalid_detailed
18+
19+
`bind:%name%` is not a valid binding. %explanation%
20+
21+
## invalid_type_attribute
22+
23+
'type' attribute must be a static text value if input uses two-way binding
24+
25+
## invalid_multiple_attribute
26+
27+
'multiple' attribute must be static if select uses two-way binding
28+
29+
## missing_contenteditable_attribute
30+
31+
'contenteditable' attribute is required for textContent, innerHTML and innerText two-way bindings
32+
33+
## dynamic_contenteditable_attribute
34+
35+
'contenteditable' attribute cannot be dynamic if element uses two-way binding
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## invalid_compiler_option
2+
3+
Invalid compiler option: %msg%
4+
5+
## removed_compiler_option
6+
7+
Invalid compiler option: %msg%
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## invalid_component_directive
2+
3+
This type of directive is not valid on components
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## invalid_const_placement
2+
3+
{@const} must be the immediate child of {#snippet}, {#if}, {:else if}, {:else}, {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## invalid_css_empty_declaration
2+
3+
Declaration cannot be empty
4+
5+
## invalid_css_global_block_list
6+
7+
A :global {...} block cannot be part of a selector list with more than one item
8+
9+
## invalid_css_global_block_modifier
10+
11+
A :global {...} block cannot modify an existing selector
12+
13+
## invalid_css_global_block_combinator
14+
15+
A :global {...} block cannot follow a %name% combinator
16+
17+
## invalid_css_global_block_declaration
18+
19+
A :global {...} block can only contain rules, not declarations
20+
21+
## invalid_css_global_placement
22+
23+
:global(...) can be at the start or end of a selector sequence, but not in the middle
24+
25+
## invalid_css_global_selector
26+
27+
:global(...) must contain exactly one selector
28+
29+
## invalid_css_global_selector_list
30+
31+
:global(...) must not contain type or universal selectors when used in a compound selector
32+
33+
## invalid_css_type_selector_placement
34+
35+
:global(...) must not be followed with a type selector
36+
37+
## invalid_css_selector
38+
39+
Invalid selector
40+
41+
## invalid_css_identifier
42+
43+
Expected a valid CSS identifier
44+
45+
## invalid_nesting_selector
46+
47+
Nesting selectors can only be used inside a rule
48+
49+
## invalid_css_declaration
50+
51+
Declaration cannot be empty
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## invalid_textarea_content
2+
3+
A `<textarea>` can have either a value attribute or (equivalently) child content, but not both
4+
5+
## invalid_void_content
6+
7+
Void elements cannot have children or closing tags
8+
9+
## invalid_element_content
10+
11+
<%name%> cannot have children
12+
13+
## invalid_tag_name
14+
15+
Expected valid tag name
16+
17+
## invalid_node_placement
18+
19+
%thing% is invalid inside <%parent%>
20+
21+
## illegal_title_attribute
22+
23+
`<title>` cannot have attributes nor directives
24+
25+
## invalid_title_content
26+
27+
`<title>` can only contain text and {tags}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## cyclical_reactive_declaration
2+
3+
Cyclical dependency detected: %cycle%

0 commit comments

Comments
 (0)