-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1051.json
More file actions
19 lines (19 loc) 路 775 Bytes
/
Copy path1051.json
File metadata and controls
19 lines (19 loc) 路 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"code": 1051,
"message": "A 'set' accessor cannot have an optional parameter.",
"regexFind": "/set\\s+([a-zA-Z_$][a-zA-Z0-9_$.-]*)\\s*\\(\\s*([^)]*)\\?([^)]*)\\)/",
"regexReplace": "set $1($2$3)",
"suggestion": "Remove the optional parameter modifier (?) from set accessor. Set accessors cannot have optional parameters - they must have exactly one required parameter.",
"example": [
{
"base": "set value(value?: string) {",
"fixed": "set value(value: string) {",
"description": "Remove optional parameter modifier from set accessor"
},
{
"base": "set config(item?: any) {",
"fixed": "set config(item: any) {",
"description": "Remove optional parameter modifier from set accessor with type annotation"
}
]
}