Disable no-unused-vars For Unused Parameter

no-unused-vars check for variables that are declared and not used anywhere in the code.

Sometimes you have a function parameter which are not used, but you don't want to remove those.

You can use { "args": "none" } for such cases.

axios({  method: 'post',  url: '/intents/login',  data: {    'username': 'test',    'password': '1234',  },})  /* eslint no-unused-vars: ["error", { "args": "none" }] */  .then((response) => {    alert('ok')  })  .catch((error) => {    alert(error.message)  })

You can also edit .eslintrc.js file in your project directory for global disable.

module.exports = {  ...  // add your custom rules here  'rules': {    'no-unused-vars': ['error', { "args": "none" }],  }}

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.