I recently started using the eslint
module to help clean-up some JavaScript files. The following error is being reported when I lint one of my files:
127:17 error Unexpected alias 'me' for 'this' consistent-this
After checking the documentation , I understand the error is being reported because my code is assigning the value of this
to a variable named me
instead of that
.
What is the proper way to configure my project's .eslintrc.json
to make it so the following line of code is not reported as an error: var me = this;
?
The rule should be like this in your .eslintrc
{
"rules" : {
"consistent-this": ["error", "me"]
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.