Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Axios is defined but never used

Tags:

vue.js

axios

After I import axios import axios from "axios"; in my App.vue file, I got axios is defined but never used error. I attached the error image and package.json code. I installed axios. How to fix it ?enter image description here

The package.json file is:

{
  "name": "myvue",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "@mdi/font": "^3.6.95",
    "@vue/test-utils": "^1.0.0-beta.29",
    "axios": "^0.19.0",
    "core-js": "^3.3.2",
    "material-design-icons-iconfont": "^5.0.1",

    "roboto-fontface": "*",
    "vue": "^2.6.10",
    "vuetify": "^2.1.10"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.0.0",
    "@vue/cli-plugin-eslint": "^4.0.0",
    "@vue/cli-service": "^4.0.0",
    "babel-eslint": "^10.0.3",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "sass": "^1.19.0",
    "sass-loader": "^8.0.0",
    "vue-cli-plugin-vuetify": "^2.0.2",
    "vue-template-compiler": "^2.6.10",
    "vuetify-loader": "^1.3.0"
  }
}
like image 508
Kaleb Avatar asked Nov 21 '19 15:11

Kaleb


1 Answers

You can solve this by updating your package.json file, under "eslintConfig" like:

...

"rules": {
  "no-console": "off",
  "no-unused-vars": "off"
}

...
like image 64
Rijo Avatar answered Oct 12 '22 23:10

Rijo