Tag Archives: ESLint Error

[Solved] Eslint Error: error ‘***’ is assigned a value but never used no-unused-vars

When writing code, I encountered such an error

 
 error  in ./src/views/CategoryEdit.vue
 
Module Error (from ./node_modules/eslint-loader/index.js):
 
D:\node-vue-moba\admin\src\views\CategoryEdit.vue
  24:11  error  'res' is assigned a value but never used  no-unused-vars
 
✖ 1 problem (1 error, 0 warnings)
✖ 1 problem (1 error, 0 warnings)
 
 
 @ ./src/router/index.js 4:0-53 13:15-27
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.0.121:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Error reason: validation syntax of eslint

Solution: add comments after the Error statement

// eslint-disable-line no-unused-vars

The code is shown below

So you don’t report mistakes!

[Solved] ESLint Error: Line 10 exceeds the maximum line length of 100

In the Vue cli component, there is a long text in the HTML encoding, and eslint reports an error: line 10 exceeds the maximum line length of 100 . Eslint sets that a line encoding cannot exceed 100 characters at most

Scheme 1:

Solution:

In the folder, there is a JS file. Eslintrc. JS to set eslint syntax, and set “Max len”: [“error”, {Code: 300}], as shown in the following figure

In the file, rules is the configured eslint syntax detection rule

You can set the encoding amount of a line according to your own needs.

Scheme 2:

the ESLIt syntax specification is ignored by setting ESLIt disable, and finally the omission is ended by setting ESLIt enable