当前位置: 首页 > 工具软件 > progress.js > 使用案例 >

# npm run serve启动项目后,修改代码,项目会自动重新编译,但是eslint会报错:Type checking in progress... # No type errors found

越飞鸾
2023-12-01

npm run serve启动项目后,修改代码,项目会自动重新编译,但是eslint会报错:Type checking in progress…

No type errors found Version: typescript 3.7.5 Time: 1111ms

ERROR  Failed to compile with 1 errors                                                                                                                                                          14:03:51
 error  in ./src/components/login/Login.vue

Module Error (from ./node_modules/eslint-loader/index.js):

F:\learn\vue\vue-typescript\src\components\login\Login.vue
   2:3   warning  Delete `··`
                           prettier/prettier
   3:5   warning  Delete `␍⏎········`
                           prettier/prettier
   5:1   warning  Delete `····`
                           prettier/prettier
   6:1   warning  Delete `····`
                           prettier/prettier
   7:1   warning  Delete `····`
                           prettier/prettier
   8:1   warning  Replace `········<el-form·:label-position="labelPosition"·label-width="80px"·:model="loginUser">` with `····<el-form␍⏎······:label-position="labelPosition"␍⏎······label-width="80px"␍⏎······:model="loginUser"`  prettier/prettier
   9:5   warning  Insert `>`
                           prettier/prettier
  10:1   warning  Delete `······`
                           prettier/prettier
  11:5   warning  Replace `␍⏎················<el-input·v-model="loginUser.username"></el-input>␍⏎····` with `····<el-input·v-model="loginUser.username"></el-input>`
                           prettier/prettier
  14:7   warning  Delete `······`
                           prettier/prettier
  15:1   warning  Delete `····`
                           prettier/prettier
  16:7   warning  Delete `······`
                           prettier/prettier
  17:3   warning  Delete `··␍⏎··········`
                           prettier/prettier
  19:1   warning  Replace `····␍⏎············` with `······`
                           prettier/prettier
  21:5   warning  Delete `␍⏎········`
                           prettier/prettier
  23:3   warning  Delete `··␍⏎····`
                           prettier/prettier
  28:45  warning  Insert `;`
                           prettier/prettier
  32:1   warning  Delete `··`
                           prettier/prettier
  32:5   error    Type string trivially inferred from a string literal, remove type annotation
                           @typescript-eslint/no-inferrable-types
  33:3   warning  Delete `··`
                           prettier/prettier
  34:3   warning  Replace `··public·username:·string·=·''` with `public·username:·string·=·""`
                           prettier/prettier
  34:5   error    Type string trivially inferred from a string literal, remove type annotation
                           @typescript-eslint/no-inferrable-types
  35:1   warning  Replace `····public·password:·string·=·''` with `··public·password:·string·=·""`
                           prettier/prettier
  35:5   error    Type string trivially inferred from a string literal, remove type annotation
                           @typescript-eslint/no-inferrable-types

✖ 24 problems (3 errors, 21 warnings)
  3 errors and 21 warnings potentially fixable with the `--fix` option.


 @ ./src/router/index.ts 5:0-49 14:13-18
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://192.168.124.4:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts

Type checking in progress...
No type errors found
Version: typescript 3.7.5
Time: 1111ms

解决方案:
修改vue.config.js

module.exports = {
  lintOnSave: false
}

默认lintOnSave为true,改为false,然后就好了

 类似资料: