'errMsg' is defined but never used no-unused-vars

api.login({
      success: (errMsg, code) => {
        resolve(code)
      }
    })

for the above code, eslint reported the following error

"errMsg" is defined but never used  no-unused-vars

errMsg cannot be deleted because of the order of parameters. In this case, how to deal with it better?

Feb.28,2021
The

error indicates that you should know because this variable is defined but not used.
if you really don't need this variable, you can edit the .eslintrc.js file, and add a 'no-unused-vars': 0 to the rules attribute to ignore the eslint rule .
you can also do this if you encounter other eslint prompts later but don't want to report a similar error.


I remember that object deconstruction does not require order, just write a code, errMsg does not need to write.

Menu