Vue警告讯息

时间:2019-07-18 10:46:29

标签: vue.js vuejs2

为什么在我的代码中以任何方式编译vue2项目大量警告消息以快速解决此问题?

在Visual Studio代码中,花很多时间才能显示出这种减弱趋势

建议我如何使用任何扩展名或格式工具解决此问题?

warning: Replace `parseFloat(this.expectedcapitalgain·/·1000).toFixed(2)` with `⏎······································parseFloat(⏎········································this.expectedcapitalgain·/·1000⏎······································).toFixed(2)⏎····································` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1214:62:
  1212 |                                   <span class="graphtext">
  1213 |                                     <i class="fa fa-circle text-warning"></i>
> 1214 |                                     Expected Capital Gain ({{parseFloat(this.expectedcapitalgain / 1000).toFixed(2)}})
       |                                                              ^
  1215 |                                   </span>
  1216 |                                   <br />
  1217 |                                   <span class="graphtext">


warning: Replace `parseFloat(this.ccashflow·/·1000).toFixed(2)` with `⏎······································parseFloat(this.ccashflow·/·1000).toFixed(⏎········································2⏎······································)⏎····································` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1219:61:
  1217 |                                   <span class="graphtext">
  1218 |                                     <i class="fa fa-circle text-danger"></i>
> 1219 |                                     Cumulative Cash Flow ({{parseFloat(this.ccashflow / 1000).toFixed(2)}})
       |                                                             ^
  1220 |                                   </span>
  1221 |                                 </div>
  1222 |                               </div>


warning: Insert `⏎·······························` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1247:80:
  1245 |                             <div class="md-layout-item">
  1246 |                               <span class="graphtext">
> 1247 |                                 <i class="fa fa-circle text-info"></i> Net Cash Flow
       |                                                                                ^
  1248 |                                 <br />
  1249 |                               </span>
  1250 |                               <span class="graphtext">


warning: Insert `⏎·······························` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1251:73:
  1249 |                               </span>
  1250 |                               <span class="graphtext">
> 1251 |                                 <i class="fa fa-circle text-danger"></i> Cumulative Net Cash Flow
       |                                                                         ^
  1252 |                               </span>
  1253 |                             </div>
  1254 |                           </div>


warning: Replace `Graph·Values·Are·In·Thousand·AED` with `⏎························Graph·Values·Are·In·Thousand·AED⏎······················` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1257:49:
  1255 |                         </template>
  1256 |                       </chart-card>
> 1257 |                       <h6 class="graphtext ral">Graph Values Are In Thousand AED</h6>
       |                                                 ^
  1258 |                     </div>
  1259 |                   </div>
  1260 |                 </template>


warning: Replace `·class="md-layout-item·md-size-100·md-medium-size-100·md-xsmall-size-100"` with `⏎··············class="md-layout-item·md-size-100·md-medium-size-100·md-xsmall-size-100"⏎············` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1268:17:
  1266 |         <template slot="tab-pane-3">
  1267 |           <div class="md-layout md-size-100">
> 1268 |             <div class="md-layout-item md-size-100 md-medium-size-100 md-xsmall-size-100">
       |                 ^
  1269 |               <global-sales-card header-color="green">
  1270 |                 <template slot="content">
  1271 |                   <div class="md-layout">


warning: Replace `·style="font-size:20px;font-weight:bold;color:#3c4858;">Documents` with `⏎························style="font-size:20px;font-weight:bold;color:#3c4858;"⏎······················>⏎························Documents⏎······················` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1273:26:
  1271 |                   <div class="md-layout">
  1272 |                     <div class="md-layout-item md-size-100 md-xsmall-size-100">
> 1273 |                       <h1 style="font-size:20px;font-weight:bold;color:#3c4858;">Documents</h1>
       |                          ^
  1274 |                       <table style="width:100%;">
  1275 |                         <tr>
  1276 |                           <td>


warning: Replace `Marin·Quays·-·Pro·forma·financials` with `⏎································Marin·Quays·-·Pro·forma·financials⏎······························` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1278:47:
  1276 |                           <td>
  1277 |                             <a href="#">
> 1278 |                               <li class="ahr">Marin Quays - Pro forma financials</li>
       |                                               ^
  1279 |                             </a>
  1280 |                           </td>
  1281 |                           <td>


warning: Replace `HiGuests·short·term·rental·report` with `⏎································HiGuests·short·term·rental·report⏎······························` (prettier/prettier) at src/pages/Dashboard/Dashboard2.vue:1305:47:
  1303 |                           <td>
  1304 |                             <a href="#">
> 1305 |                               <li class="ahr">HiGuests short term rental report</li>
       |                                               ^
  1306 |                             </a>
  1307 |                           </td>
  1308 |                         </tr>


error: 'vueNumeralFilterInstaller' is defined but never used (no-unused-vars) at src/pages/Dashboard/Dashboard2.vue:1426:8:
  1424 | import VueEasyLightbox from "vue-easy-lightbox";
  1425 | Vue.use(VueEasyLightbox);
> 1426 | import vueNumeralFilterInstaller from "vue-numeral-filter";
       |        ^
  1427 | import { API_KEY } from "./Maps/API_KEY";
  1428 | import GoogleMapsLoader from "google-maps";
  1429 | GoogleMapsLoader.KEY = API_KEY;


error: 'APIService' is defined but never used (no-unused-vars) at src/pages/Dashboard/Dashboard2.vue:1439:10:
  1437 | import GoogleAtmMap from "../../components/GoogleAtmMap";
  1438 | import GoogleGymMap from "../../components/GoogleGymMap";
> 1439 | import { APIService } from "../../apiservice.js";
       |          ^
  1440 | import {
  1441 |   StatsCard,
  1442 |   ChartCard,


2 errors and 247 warnings found.
247 warnings potentially fixable with the `--fix` option.

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

  App running at:
  - Local:   http://localhost:8080 
  - Network: http://192.168.0.105:8080

像这样,每次编译时都会显示警告消息。使用vscode修复此意图的任何方法

1 个答案:

答案 0 :(得分:0)

如错误消息中所述,您可以通过运行以下命令来解决问题:

$ npm run lint -- --fix

将来,您可以通过安装ESLint扩展并启用eslint.autoFixOnSave选项(如此处记录的https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

)来使VSCode自动解决这些问题。