File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ module.exports = {
7676
7777 fixable : "code" ,
7878 messages : {
79- replaced : "Assignment can be replaced with operator assignment." ,
80- unexpected : "Unexpected operator assignment shorthand."
79+ replaced : "Assignment (=) can be replaced with operator assignment ({{operator}}=) ." ,
80+ unexpected : "Unexpected operator assignment ({{operator}}=) shorthand."
8181 }
8282 } ,
8383
@@ -113,6 +113,7 @@ module.exports = {
113113 context . report ( {
114114 node,
115115 messageId : "replaced" ,
116+ data : { operator } ,
116117 fix ( fixer ) {
117118 if ( canBeFixed ( left ) && canBeFixed ( expr . left ) ) {
118119 const equalsToken = getOperatorToken ( node ) ;
@@ -139,7 +140,8 @@ module.exports = {
139140 */
140141 context . report ( {
141142 node,
142- messageId : "replaced"
143+ messageId : "replaced" ,
144+ data : { operator }
143145 } ) ;
144146 }
145147 }
@@ -155,6 +157,7 @@ module.exports = {
155157 context . report ( {
156158 node,
157159 messageId : "unexpected" ,
160+ data : { operator : node . operator } ,
158161 fix ( fixer ) {
159162 if ( canBeFixed ( node . left ) ) {
160163 const firstToken = sourceCode . getFirstToken ( node ) ;
You can’t perform that action at this time.
0 commit comments