用腳手架創建一個vue cli3項目,采用eslint+Prettie 進行代碼格式化。
啟用eslint 后會有 Failed to load config "standard" to extend from.報錯
解決辦法
yarn add eslint-plugin-promise
yarn add eslint-plugin-node
yarn add eslint-plugin-import
yarn add eslint-plugin-standard
yarn add eslint-config-standard
錯誤代碼 Expected indentation of 2 spaces but found 1 tab
解決辦法 rules中添加 indent: ['error', 'tab'], eslint默認是用2個空格縮進,這句話改為使用tab縮進 ,配合.editorconfig文件中的
indent_style = tab
indent_size = 4 代碼4空格縮進效果
eslint 配置 解決 4個空格,空格與tab沖突等問題
添加.editorconfig .eslintignore .eslintrc.js 這三個文件
需改 settings.json
給一個調好eslint的的鏈接 提取碼7uff