Postcss warning:
1血巍、You should write display: flex by final spec instead of display: box
解決方案:去除display: box
2、Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules.
解決方案:
/* autoprefixer: off*/····/* autoprefixer: on*/
換成 /*! autoprefixer: ignore next */
Eslint error
1、error: Unreachable code (no-unreachable)
return仲闽、throw后面的語句:
2秧荆、'xxx' is assigned a value but never used (no-unused-vars)
賦值了但沒有引用
3、'xxx' is defined but never used (no-unused-vars)
沒有引用的import
4氏堤、The "xxx" component has been registered but not used (vue/no-unused-components)
注冊了組件档插,但沒有用到
5慢蜓、Duplicate key 'xxx' (no-dupe-keys)
data重復(fù)聲明
6、Identifier 'xx_x' is not in camel case (camelcase)
js里變量沒有使用駝峰
7郭膛、'xxx' is not defined (no-undef)
引用了未定義的變量等
8晨抡、Irregular whitespace not allowed (no-irregular-whitespace)
空格問題
9、Mixed spaces and tabs (no-mixed-spaces-and-tabs)
tab與空格混用
10则剃、Unnecessary escape character (no-useless-escape) :\h :/
多余的轉(zhuǎn)義字符
11耘柱、 Expected the Promise rejection reason to be an Error (prefer-promise-reject-errors) :reject()
promise的reject需要指定error
12、Expected to return a value in "xxx" computed property (vue/return-in-computed-property)
計算屬性存在沒有返回的場景
13棍现、Type of the default value for 'xxx' prop must be a function (vue/require-valid-default-prop)
props對象的默認值必須使用工廠方法聲明
14调煎、'xxx' was used before it was defined (no-use-before-define)
實例: let v = (v = this.memberId ? '^' + 'Y' : '^' + 'N')
15、Expected error to be handled (handle-callback-err)
異常沒有處理
16己肮、Parsing error: control-character-in-input-stream (vue/no-parsing-error)
單行注釋//
位置不對
17士袄、Expected an assignment or function call and instead saw an expression (no-unused-expressions)
期望一個賦值或函數(shù)調(diào)用,卻看到一個表達式
18朴肺、 Closing curly brace does not appear on the same line as the subsequent block (brace-style)
右大括號與下一個塊不在同一行
19窖剑、 Unexpected literal in error position of callback (standard/no-callback-literal)
callback(true/false/1)在ES6里是不被允許的,https://github.com/standard/standard/issues/623
20戈稿、 'xxx' is already defined (no-redeclare)
var 變量引起的
21西土、 Unexpected trailing comma (comma-dangle)
多了一個逗號
22、 Parsing error: x-invalid-end-tag (vue/no-parsing-error)
自閉合標(biāo)簽用了end標(biāo)簽鞍盗,例:</img>
23需了、 Elements in iteration expect to have 'v-bind:key' directives (vue/require-v-for-key)
使用v-for
時,沒有設(shè)置key
24般甲、Expected a 'break' statement before 'case' (no-fallthrough)
case
前需要設(shè)置break