update some compiler error messages

pull/6413/head
Conduitry 5 years ago committed by tanhauhau
parent 9b52dcbbbf
commit 72a548950c

@ -212,7 +212,7 @@ export default {
},
invalid_attribute_value: (name: string) => ({
code: `invalid-${name}-value`,
message: `${name} attribute must be true or false`
message: `${name} attribute must be true or false`
}),
invalid_options_attribute_unknown: {
code: 'invalid-options-attribute',
@ -248,7 +248,7 @@ export default {
},
invalid_const_placement: {
code: 'invalid-const-placement',
message: '{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>'
message: '{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>'
},
invalid_const_declaration: (name: string) => ({
code: 'invalid-const-declaration',
@ -256,10 +256,10 @@ export default {
}),
invalid_const_update: (name: string) => ({
code: 'invalid-const-update',
message: `'${name}' is declared using {@const ...} and it is read-only`
message: `'${name}' is declared using {@const ...} and is read-only`
}),
cyclical_constant_tags: (cycle: string[]) => ({
code: 'cyclical-constant-tags',
cyclical_const_tags: (cycle: string[]) => ({
code: 'cyclical-const-tags',
message: `Cyclical dependency detected: ${cycle.join(' → ')}`
})
};

@ -68,7 +68,7 @@ function sort_consts_nodes(consts_nodes: ConstTag[], component: Component) {
if (cycle && cycle.length) {
const nodeList = lookup.get(cycle[0]);
const node = nodeList[0];
component.error(node.node, compiler_errors.cyclical_constant_tags(cycle));
component.error(node.node, compiler_errors.cyclical_const_tags(cycle));
}
const add_node = (node: ConstNode) => {

@ -1,6 +1,6 @@
[
{
"code": "cyclical-constant-tags",
"code": "cyclical-const-tags",
"message": "Cyclical dependency detected: b → c → b",
"start": { "line": 6, "column": 2, "character": 61 },
"end": { "line": 6, "column": 20, "character": 79 },

@ -1,7 +1,7 @@
[
{
"code": "invalid-const-placement",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>",
"start": { "line": 5, "column": 0, "character": 36 },
"end": { "line": 5, "column": 18, "character": 54 },
"pos": 36

@ -1,7 +1,7 @@
[
{
"code": "invalid-const-placement",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>",
"start": { "line": 6, "column": 2, "character": 46 },
"end": { "line": 6, "column": 20, "character": 64 },
"pos": 46

@ -1,7 +1,7 @@
[
{
"code": "invalid-const-placement",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>",
"start": { "line": 7, "column": 4, "character": 63 },
"end": { "line": 7, "column": 18, "character": 77 },
"pos": 63

@ -1,7 +1,7 @@
[
{
"code": "invalid-const-update",
"message": "'b' is declared using {@const ...} and it is read-only",
"message": "'b' is declared using {@const ...} and is read-only",
"start": { "line": 7, "column": 26, "character": 106 },
"end": { "line": 7, "column": 30, "character": 110 },
"pos": 106

Loading…
Cancel
Save