-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathbasic-errors.yaml
174 lines (162 loc) · 6.78 KB
/
basic-errors.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
- message: SvelteSet is already reactive. `$state` wrapping is unnecessary. Update it with mutations (e.g., .add(), .delete(), .push(), .splice()).
line: 12
column: 21
suggestions:
- desc: Remove the unnecessary `$state` and update the value via mutations (e.g., .add(), .delete(), .push(), .splice()).
messageId: suggestRemoveStateWrap
output: |
<script>
import {
SvelteSet,
SvelteMap,
SvelteURL,
SvelteURLSearchParams,
SvelteDate,
MediaQuery
} from 'svelte/reactivity';
// These should be reported as unnecessary $state wrapping
const set = new SvelteSet();
const map = $state(new SvelteMap());
const url = $state(new SvelteURL('https://example.com'));
const params = $state(new SvelteURLSearchParams('key=value'));
const date = $state(new SvelteDate());
const mediaQuery = $state(new MediaQuery('(min-width: 800px)'));
// Regular state usage is still valid
const regularState = $state(42);
const stateObject = $state({ foo: 'bar' });
</script>
- message: SvelteMap is already reactive. `$state` wrapping is unnecessary. Update it with mutations (e.g., .add(), .delete(), .push(), .splice()).
line: 13
column: 21
suggestions:
- desc: Remove the unnecessary `$state` and update the value via mutations (e.g., .add(), .delete(), .push(), .splice()).
messageId: suggestRemoveStateWrap
output: |
<script>
import {
SvelteSet,
SvelteMap,
SvelteURL,
SvelteURLSearchParams,
SvelteDate,
MediaQuery
} from 'svelte/reactivity';
// These should be reported as unnecessary $state wrapping
const set = $state(new SvelteSet());
const map = new SvelteMap();
const url = $state(new SvelteURL('https://example.com'));
const params = $state(new SvelteURLSearchParams('key=value'));
const date = $state(new SvelteDate());
const mediaQuery = $state(new MediaQuery('(min-width: 800px)'));
// Regular state usage is still valid
const regularState = $state(42);
const stateObject = $state({ foo: 'bar' });
</script>
- message: SvelteURL is already reactive. `$state` wrapping is unnecessary. Update it with mutations (e.g., .add(), .delete(), .push(), .splice()).
line: 14
column: 21
suggestions:
- desc: Remove the unnecessary `$state` and update the value via mutations (e.g., .add(), .delete(), .push(), .splice()).
messageId: suggestRemoveStateWrap
output: |
<script>
import {
SvelteSet,
SvelteMap,
SvelteURL,
SvelteURLSearchParams,
SvelteDate,
MediaQuery
} from 'svelte/reactivity';
// These should be reported as unnecessary $state wrapping
const set = $state(new SvelteSet());
const map = $state(new SvelteMap());
const url = new SvelteURL('https://example.com');
const params = $state(new SvelteURLSearchParams('key=value'));
const date = $state(new SvelteDate());
const mediaQuery = $state(new MediaQuery('(min-width: 800px)'));
// Regular state usage is still valid
const regularState = $state(42);
const stateObject = $state({ foo: 'bar' });
</script>
- message: SvelteURLSearchParams is already reactive. `$state` wrapping is unnecessary. Update it with mutations (e.g., .add(), .delete(), .push(), .splice()).
line: 15
column: 24
suggestions:
- desc: Remove the unnecessary `$state` and update the value via mutations (e.g., .add(), .delete(), .push(), .splice()).
messageId: suggestRemoveStateWrap
output: |
<script>
import {
SvelteSet,
SvelteMap,
SvelteURL,
SvelteURLSearchParams,
SvelteDate,
MediaQuery
} from 'svelte/reactivity';
// These should be reported as unnecessary $state wrapping
const set = $state(new SvelteSet());
const map = $state(new SvelteMap());
const url = $state(new SvelteURL('https://example.com'));
const params = new SvelteURLSearchParams('key=value');
const date = $state(new SvelteDate());
const mediaQuery = $state(new MediaQuery('(min-width: 800px)'));
// Regular state usage is still valid
const regularState = $state(42);
const stateObject = $state({ foo: 'bar' });
</script>
- message: SvelteDate is already reactive. `$state` wrapping is unnecessary. Update it with mutations (e.g., .add(), .delete(), .push(), .splice()).
line: 16
column: 22
suggestions:
- desc: Remove the unnecessary `$state` and update the value via mutations (e.g., .add(), .delete(), .push(), .splice()).
messageId: suggestRemoveStateWrap
output: |
<script>
import {
SvelteSet,
SvelteMap,
SvelteURL,
SvelteURLSearchParams,
SvelteDate,
MediaQuery
} from 'svelte/reactivity';
// These should be reported as unnecessary $state wrapping
const set = $state(new SvelteSet());
const map = $state(new SvelteMap());
const url = $state(new SvelteURL('https://example.com'));
const params = $state(new SvelteURLSearchParams('key=value'));
const date = new SvelteDate();
const mediaQuery = $state(new MediaQuery('(min-width: 800px)'));
// Regular state usage is still valid
const regularState = $state(42);
const stateObject = $state({ foo: 'bar' });
</script>
- message: MediaQuery is already reactive. `$state` wrapping is unnecessary. Update it with mutations (e.g., .add(), .delete(), .push(), .splice()).
line: 17
column: 28
suggestions:
- desc: Remove the unnecessary `$state` and update the value via mutations (e.g., .add(), .delete(), .push(), .splice()).
messageId: suggestRemoveStateWrap
output: |
<script>
import {
SvelteSet,
SvelteMap,
SvelteURL,
SvelteURLSearchParams,
SvelteDate,
MediaQuery
} from 'svelte/reactivity';
// These should be reported as unnecessary $state wrapping
const set = $state(new SvelteSet());
const map = $state(new SvelteMap());
const url = $state(new SvelteURL('https://example.com'));
const params = $state(new SvelteURLSearchParams('key=value'));
const date = $state(new SvelteDate());
const mediaQuery = new MediaQuery('(min-width: 800px)');
// Regular state usage is still valid
const regularState = $state(42);
const stateObject = $state({ foo: 'bar' });
</script>