Skip to content

Commit c839acb

Browse files
authored
feat: add doc urls (#5702)
* feat: add doc urls * fix: update metadata URLs for error codes in various test fixtures
1 parent 1b6ffb4 commit c839acb

File tree

41 files changed

+105
-105
lines changed

Some content is hidden

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

41 files changed

+105
-105
lines changed

packages/@lwc/errors/src/compiler/error-info/compiler.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const GENERIC_COMPILER_ERROR = {
1515
message: 'Unexpected compilation error: {0}',
1616
level: DiagnosticLevel.Error,
1717
strictLevel: DiagnosticLevel.Fatal,
18-
url: '',
18+
url: 'https://lwc.dev/guide/error_codes#lwc1001',
1919
} as const satisfies LWCErrorInfo;
2020

2121
export const CompilerValidationErrors = {
@@ -44,7 +44,7 @@ export const CompilerValidationErrors = {
4444
code: 1016,
4545
message: 'Expected an object with files to be compiled.',
4646
level: DiagnosticLevel.Error,
47-
url: '',
47+
url: 'https://lwc.dev/guide/error_codes#lwc1016',
4848
},
4949

5050
INVALID_NAME_PROPERTY: {
@@ -66,14 +66,14 @@ export const CompilerValidationErrors = {
6666
message:
6767
'Expected a boolean value or \'inline\' for outputConfig.sourcemap, received "{0}".',
6868
level: DiagnosticLevel.Error,
69-
url: '',
69+
url: 'https://lwc.dev/guide/error_codes#lwc1021',
7070
},
7171

7272
MISSING_OPTIONS_OBJECT: {
7373
code: 1023,
7474
message: 'Expected options object, received "{0}".',
7575
level: DiagnosticLevel.Error,
76-
url: '',
76+
url: 'https://lwc.dev/guide/error_codes#lwc1023',
7777
},
7878

7979
UNEXPECTED_FILE_CONTENT: {
@@ -162,7 +162,7 @@ export const TransformerErrors = {
162162
message: '{0}',
163163
level: DiagnosticLevel.Error,
164164
strictLevel: DiagnosticLevel.Fatal,
165-
url: '',
165+
url: 'https://lwc.dev/guide/error_codes#lwc1009',
166166
},
167167
CSS_IN_HTML_ERROR: {
168168
code: 1026,
@@ -185,7 +185,7 @@ export const TransformerErrors = {
185185
message: 'Expect a string for id. Received {0}',
186186
level: DiagnosticLevel.Error,
187187
strictLevel: DiagnosticLevel.Fatal,
188-
url: '',
188+
url: 'https://lwc.dev/guide/error_codes#lwc1027',
189189
},
190190

191191
INVALID_SOURCE: {
@@ -201,7 +201,7 @@ export const TransformerErrors = {
201201
message: '{0}',
202202
level: DiagnosticLevel.Error,
203203
strictLevel: DiagnosticLevel.Fatal,
204-
url: '',
204+
url: 'https://lwc.dev/guide/error_codes#lwc1007',
205205
},
206206

207207
NO_AVAILABLE_TRANSFORMER: {

packages/@lwc/errors/src/compiler/error-info/lwc-class.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const LWCClassErrors = {
1515
code: 1121,
1616
message:
1717
'Invalid import. The argument "{0}" must be a stringLiteral for dynamic imports when strict mode is enabled.',
18-
url: '',
18+
url: 'https://lwc.dev/guide/error_codes#lwc1121',
1919
level: DiagnosticLevel.Error,
2020
},
2121
} as const satisfies Record<string, LWCErrorInfo>;
@@ -26,42 +26,42 @@ export const DecoratorErrors = {
2626
message:
2727
'@wire expects an adapter as first parameter. @wire(adapter: WireAdapter, config?: any).',
2828
level: DiagnosticLevel.Error,
29-
url: '',
29+
url: 'https://lwc.dev/guide/error_codes#lwc1092',
3030
},
3131

3232
API_AND_TRACK_DECORATOR_CONFLICT: {
3333
code: 1093,
3434
message: '@api method or property cannot be used with @track',
3535
level: DiagnosticLevel.Error,
36-
url: '',
36+
url: 'https://lwc.dev/guide/error_codes#lwc1093',
3737
},
3838

3939
CONFIG_OBJECT_SHOULD_BE_SECOND_PARAMETER: {
4040
code: 1094,
4141
message: '@wire expects a configuration object expression as second parameter.',
4242
level: DiagnosticLevel.Error,
43-
url: '',
43+
url: 'https://lwc.dev/guide/error_codes#lwc1094',
4444
},
4545

4646
CONFLICT_WITH_ANOTHER_DECORATOR: {
4747
code: 1095,
4848
message: '@wire method or property cannot be used with @{0}',
4949
level: DiagnosticLevel.Error,
50-
url: '',
50+
url: 'https://lwc.dev/guide/error_codes#lwc1095',
5151
},
5252

5353
DUPLICATE_API_PROPERTY: {
5454
code: 1096,
5555
message: 'Duplicate @api property "{0}".',
5656
level: DiagnosticLevel.Error,
57-
url: '',
57+
url: 'https://lwc.dev/guide/error_codes#lwc1096',
5858
},
5959

6060
FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER: {
6161
code: 1097,
6262
message: '@wire expects a function identifier as first parameter.',
6363
level: DiagnosticLevel.Error,
64-
url: '',
64+
url: 'https://lwc.dev/guide/error_codes#lwc1097',
6565
},
6666

6767
IMPORTED_FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER: {
@@ -75,7 +75,7 @@ export const DecoratorErrors = {
7575
code: 1099,
7676
message: 'Boolean public property must default to false.',
7777
level: DiagnosticLevel.Error,
78-
url: '',
78+
url: 'https://lwc.dev/guide/error_codes#lwc1099',
7979
},
8080

8181
INVALID_DECORATOR: {
@@ -119,61 +119,61 @@ export const DecoratorErrors = {
119119
code: 1105,
120120
message: 'Method or property can only have 1 @wire decorator',
121121
level: DiagnosticLevel.Error,
122-
url: '',
122+
url: 'https://lwc.dev/guide/error_codes#lwc1105',
123123
},
124124

125125
PROPERTY_CANNOT_BE_COMPUTED: {
126126
code: 1106,
127127
message: '@api cannot be applied to a computed property, getter, setter or method.',
128128
level: DiagnosticLevel.Error,
129-
url: '',
129+
url: 'https://lwc.dev/guide/error_codes#lwc1106',
130130
},
131131

132132
PROPERTY_NAME_CANNOT_START_WITH_DATA: {
133133
code: 1107,
134134
message:
135135
'Invalid property name "{0}". Properties starting with "data" are reserved attributes.',
136136
level: DiagnosticLevel.Error,
137-
url: '',
137+
url: 'https://lwc.dev/guide/error_codes#lwc1107',
138138
},
139139

140140
PROPERTY_NAME_CANNOT_START_WITH_ON: {
141141
code: 1108,
142142
message:
143143
'Invalid property name "{0}". Properties starting with "on" are reserved for event handlers.',
144144
level: DiagnosticLevel.Error,
145-
url: '',
145+
url: 'https://lwc.dev/guide/error_codes#lwc1108',
146146
},
147147

148148
PROPERTY_NAME_IS_AMBIGUOUS: {
149149
code: 1109,
150150
message:
151151
'Ambiguous attribute name "{0}". "{0}" will never be called from template because its corresponding property is camel cased. Consider renaming to "{1}".',
152152
level: DiagnosticLevel.Error,
153-
url: '',
153+
url: 'https://lwc.dev/guide/error_codes#lwc1109',
154154
},
155155

156156
PROPERTY_NAME_IS_RESERVED: {
157157
code: 1110,
158158
message: 'Invalid property name "{0}". "{0}" is a reserved attribute.',
159159
level: DiagnosticLevel.Error,
160-
url: '',
160+
url: 'https://lwc.dev/guide/error_codes#lwc1110',
161161
},
162162

163163
PROPERTY_NAME_PART_IS_RESERVED: {
164164
code: 1111,
165165
message:
166166
'Invalid property name "{0}". "part" is a future reserved attribute for web components.',
167167
level: DiagnosticLevel.Error,
168-
url: '',
168+
url: 'https://lwc.dev/guide/error_codes#lwc1111',
169169
},
170170

171171
SINGLE_DECORATOR_ON_SETTER_GETTER_PAIR: {
172172
code: 1112,
173173
message:
174174
'@api get {0} and @api set {0} detected in class declaration. Only one of the two needs to be decorated with @api.',
175175
level: DiagnosticLevel.Error,
176-
url: '',
176+
url: 'https://lwc.dev/guide/error_codes#lwc1112',
177177
},
178178

179179
TRACK_ONLY_ALLOWED_ON_CLASS_PROPERTIES: {
@@ -194,28 +194,28 @@ export const DecoratorErrors = {
194194
code: 1131,
195195
message: '@wire identifier cannot contain computed properties',
196196
level: DiagnosticLevel.Error,
197-
url: '',
197+
url: 'https://lwc.dev/guide/error_codes#lwc1131',
198198
},
199199

200200
FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS: {
201201
code: 1132,
202202
message: '@wire identifier cannot contain nested member expressions',
203203
level: DiagnosticLevel.Error,
204-
url: '',
204+
url: 'https://lwc.dev/guide/error_codes#lwc1132',
205205
},
206206

207207
COMPUTED_PROPERTY_CANNOT_BE_TEMPLATE_LITERAL: {
208208
code: 1199,
209209
message:
210210
'Cannot use a template literal as a computed property key. Instead, use a string or extract the value to a constant.',
211211
level: DiagnosticLevel.Error,
212-
url: '',
212+
url: 'https://lwc.dev/guide/error_codes#lwc1199',
213213
},
214214

215215
COMPUTED_PROPERTY_MUST_BE_CONSTANT_OR_LITERAL: {
216216
code: 1200,
217217
message: 'Computed property in @wire config must be a constant or primitive literal.',
218218
level: DiagnosticLevel.Error,
219-
url: '',
219+
url: 'https://lwc.dev/guide/error_codes#lwc1200',
220220
},
221221
} as const satisfies Record<string, LWCErrorInfo>;

packages/@lwc/errors/src/compiler/error-info/template-transform.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const ParserDiagnostics = {
6363
'If you want to make it a valid identifier you should remove the surrounding quotes {1}. ' +
6464
'If you want to make it a string you should escape it {2}.',
6565
level: DiagnosticLevel.Error,
66-
url: '',
66+
url: 'https://lwc.dev/guide/error_codes#lwc1034',
6767
},
6868

6969
AMBIGUOUS_ATTRIBUTE_VALUE_STRING: {
@@ -81,7 +81,7 @@ export const ParserDiagnostics = {
8181
'To represent a false value, the attribute has to be omitted altogether.',
8282

8383
level: DiagnosticLevel.Error,
84-
url: '',
84+
url: 'https://lwc.dev/guide/error_codes#lwc1036',
8585
},
8686

8787
BOOLEAN_ATTRIBUTE_TRUE: {
@@ -171,23 +171,23 @@ export const ParserDiagnostics = {
171171
code: 1048,
172172
message: 'srcdoc attribute is disallowed on <iframe> for security reasons',
173173
level: DiagnosticLevel.Error,
174-
url: '',
174+
url: 'https://lwc.dev/guide/error_codes#lwc1048',
175175
},
176176

177177
FORBIDDEN_SVG_NAMESPACE_IN_TEMPLATE: {
178178
code: 1049,
179179
message:
180180
"Forbidden svg namespace tag found in template: '<{0}>' tag is not allowed within <svg>",
181181
level: DiagnosticLevel.Error,
182-
url: '',
182+
url: 'https://lwc.dev/guide/error_codes#lwc1049',
183183
},
184184

185185
FORBIDDEN_MATHML_NAMESPACE_IN_TEMPLATE: {
186186
code: 1050,
187187
message:
188188
"Forbidden MathML namespace tag found in template: '<{0}>' tag is not allowed within <math>",
189189
level: DiagnosticLevel.Error,
190-
url: '',
190+
url: 'https://lwc.dev/guide/error_codes#lwc1050',
191191
},
192192

193193
FORBIDDEN_TAG_ON_TEMPLATE: {
@@ -398,7 +398,7 @@ export const ParserDiagnostics = {
398398
message: 'Error parsing template expression: {0}',
399399
level: DiagnosticLevel.Error,
400400
strictLevel: DiagnosticLevel.Fatal,
401-
url: '',
401+
url: 'https://lwc.dev/guide/error_codes#lwc1083',
402402
},
403403

404404
UNEXPECTED_IF_MODIFIER: {
@@ -450,7 +450,7 @@ export const ParserDiagnostics = {
450450
message:
451451
"Unknown html tag '<{0}>'. For more information refer to https://developer.mozilla.org/en-US/docs/Web/HTML/Element and https://developer.mozilla.org/en-US/docs/Web/SVG/Element",
452452
level: DiagnosticLevel.Warning,
453-
url: '',
453+
url: 'https://lwc.dev/guide/error_codes#lwc1123',
454454
},
455455

456456
ATTRIBUTE_NAME_STARTS_WITH_INVALID_CHARACTER: {
@@ -631,7 +631,7 @@ export const ParserDiagnostics = {
631631
message:
632632
'Invalid key attribute on element <{0}>. The key attribute should be applied to an element with for:each or iterator:*, or to a direct child of a <template> element with for:each or iterator:*. This key will be ignored, and may throw an error in future versions of LWC.',
633633
level: DiagnosticLevel.Warning,
634-
url: '',
634+
url: 'https://lwc.dev/guide/error_codes#lwc1149',
635635
},
636636

637637
INVALID_TEMPLATE_WARNING: {
@@ -946,15 +946,15 @@ export const ParserDiagnostics = {
946946
code: 1197,
947947
message: 'Use of comments is disallowed within template expressions.',
948948
level: DiagnosticLevel.Error,
949-
url: '',
949+
url: 'https://lwc.dev/guide/error_codes#lwc1197',
950950
},
951951

952952
IGNORED_SLOT_ATTRIBUTE_IN_CHILD: {
953953
code: 1201,
954954
message:
955955
'The slot attribute in {0} will be ignored due to its ancestor {1}. It must be a direct child of the containing component.',
956956
level: DiagnosticLevel.Warning,
957-
url: '',
957+
url: 'https://lwc.dev/guide/error_codes#lwc1201',
958958
},
959959

960960
INVALID_LWC_ON_ELEMENT: {

packages/@lwc/template-compiler/src/__tests__/fixtures/attributes/error-ambiguous-attribute/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start": 22,
1111
"length": 17
1212
},
13-
"url": ""
13+
"url": "https://lwc.dev/guide/error_codes#lwc1034"
1414
},
1515
{
1616
"code": 1035,

packages/@lwc/template-compiler/src/__tests__/fixtures/attributes/error-boolean/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"start": 43,
2323
"length": 12
2424
},
25-
"url": ""
25+
"url": "https://lwc.dev/guide/error_codes#lwc1036"
2626
},
2727
{
2828
"code": 1037,
@@ -46,7 +46,7 @@
4646
"start": 96,
4747
"length": 14
4848
},
49-
"url": ""
49+
"url": "https://lwc.dev/guide/error_codes#lwc1036"
5050
}
5151
]
5252
}

packages/@lwc/template-compiler/src/__tests__/fixtures/attributes/unknown-html-tag-known-attribute/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"code": 1123,
55
"message": "LWC1123: Unknown html tag '<somefancytag>'. For more information refer to https://developer.mozilla.org/en-US/docs/Web/HTML/Element and https://developer.mozilla.org/en-US/docs/Web/SVG/Element",
66
"level": 2,
7-
"url": "",
7+
"url": "https://lwc.dev/guide/error_codes#lwc1123",
88
"location": {
99
"line": 2,
1010
"column": 5,

packages/@lwc/template-compiler/src/__tests__/fixtures/directive-key/outside-iterator/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"code": 1149,
55
"message": "LWC1149: Invalid key attribute on element <div>. The key attribute should be applied to an element with for:each or iterator:*, or to a direct child of a <template> element with for:each or iterator:*. This key will be ignored, and may throw an error in future versions of LWC.",
66
"level": 2,
7-
"url": "",
7+
"url": "https://lwc.dev/guide/error_codes#lwc1149",
88
"location": {
99
"line": 2,
1010
"column": 10,

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/comments/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start": 40,
1111
"length": 79
1212
},
13-
"url": ""
13+
"url": "https://lwc.dev/guide/error_codes#lwc1197"
1414
}
1515
]
1616
}

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/html-decoding/experimental-complex-expressions-true-attr/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start": 125,
1111
"length": 15
1212
},
13-
"url": ""
13+
"url": "https://lwc.dev/guide/error_codes#lwc1083"
1414
}
1515
]
1616
}

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/html-decoding/experimental-complex-expressions-true/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start": 125,
1111
"length": 15
1212
},
13-
"url": ""
13+
"url": "https://lwc.dev/guide/error_codes#lwc1083"
1414
}
1515
]
1616
}

0 commit comments

Comments
 (0)