我为Vue CLI项目选择的预设具有一些规则,可以警告我有关HTML的内容,例如:
<form>
Start:<input type="date" name="date1" required="required" value="dd/m/year" /><br> End: <input type="date" name="date2" required="required" value="dd/m/year" />
<input type="button" name="button1" value="Get Elapsed Time" />
</form>
我不同意此规则,并希望将其关闭。但是,很难从消息本身中找出这是什么规则。
我想知道如何配置Vue CLI和/或eslint告诉我该规则是什么,以便不仅为该特定规则设置,而且在如果我想关闭其他规则。
我如何找出与基于vue-cli的eslint警告相关的特定规则?
我当前的warning: Replace `·title="Publicly·Visible"·:class="{·inactive:·!member.isPubliclyVisible·}">�</span` with `␍⏎··············title="Publicly·Visible"␍⏎··············:class="{ ·inactive:·!member.isPubliclyVisible·}"␍⏎··············>�</span␍⏎············` (prettier/prettier) at src\views\MemberList.vue:29:18:
27 | <span title="Archived" :class="{ inactive: !member.isArchived }">�</span>
28 | <span title="Honorary Member" :class="{ inactive: !member.isHonoraryMember }">�</span>
> 29 | <span title="Publicly Visible" :class="{ inactive: !member.isPubliclyVisible }"> </span>
| ^
30 | <span title="Student" :class="{ inactive: !member.isStudent }">�</span>
31 | </td>
32 | </tr>
文件如下:
.eslintrc.js
当我运行module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/essential", "@vue/prettier"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
},
parserOptions: {
parser: "babel-eslint"
}
};
时,出现引用错误,该错误依次运行npm serve
。