Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hakhsin's avatar

Disable unused variable error

Hi, how can I disable unused variable error? I know I have to add this 'vue/no-unused-vars': 'off' to .eslintrc.js but it doesn't work for me. Now, what do I do? Here is my .eslintrc.js file content:

module.exports = {
  root: true,
  env: {
    node: true
  },
  'extends': [
    'plugin:vue/strongly-recommended',
    'eslint:recommended'
  ],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'vue/no-unused-vars': 'off'
  },
  parserOptions: {
    parser: 'babel-eslint'
  }
};
0 likes
4 replies
bobbybouwmann's avatar

Your syntax is correct, but I think you use the wrong rule here. Shouldn't it be just no-unused-vars, without the vue part.

rules: 
    'no-unused-vars': 'off'
},
bobbybouwmann's avatar

I'm not an expert in this, but this should be the correct setup for this AFAIK.

1 like
hakhsin's avatar

@bobbybouwmann, cant It related to using local dependence? Here is my package.json:

{
  "name": "pimosin",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^2.6.5",
    "vue": "^2.6.10",
    "vue-router": "^3.0.3",
    // Here is my local dependency!
    "vuesin": "D:\Projects\Hakhsin\vuesin",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.12.0",
    "@vue/cli-plugin-eslint": "^3.12.0",
    "@vue/cli-service": "^3.12.0",
    "babel-eslint": "^10.0.1",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "sass": "^1.19.0",
    "sass-loader": "^8.0.0",
    "tailwindcss": "^1.1.2",
    "vue-template-compiler": "^2.6.10"
  }
}

Because when I update vuesin package I get those errors.

Please or to participate in this conversation.