-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1049.json
More file actions
19 lines (19 loc) 路 891 Bytes
/
Copy path1049.json
File metadata and controls
19 lines (19 loc) 路 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"code": 1049,
"message": "A 'set' accessor must have exactly one parameter.",
"regexFind": "/set\\s+([a-zA-Z_$][a-zA-Z0-9_$.-]*)\\s*\\(\\s*\\)/",
"regexReplace": "set $1(value: any)",
"suggestion": "Add exactly one parameter to set accessor. Set accessors must have exactly one parameter to receive the value being assigned.",
"example": [
{
"base": "class TestClass {\n set value() {\n this._value = 'test'\n }\n}",
"fixed": "class TestClass {\n set value(newValue: string) {\n this._value = newValue\n }\n}",
"description": "Add parameter to set accessor"
},
{
"base": "class DataClass {\n set config() {\n this._config = {}\n }\n}",
"fixed": "class DataClass {\n set config(newConfig: object) {\n this._config = newConfig\n }\n}",
"description": "Add parameter to set accessor with proper type"
}
]
}