Expected indentation of 14 spaces but found 16
vue專案裡,命令列報了很多錯,幾乎全是Expected indentation of 14 spaces but found 16類似這樣的,翻譯過來是:預期縮排14個空格,但找到16個空格,解決方法很簡單,就直接刪除多餘的空格。
然而這種問題太多了,只要用Tab鍵,就會有這種錯。
原因:ESLint是一個語法規則和程式碼風格的檢查工具,可以用來保證寫出語法正確、風格統一的程式碼。預設要求2個空格
解決辦法:
不是關閉ESLint,因為用了它之後程式碼比較規範,應該刻意使用,養成良好的程式碼習慣。
找到settings.json,新增如下程式碼:
{
"editor.tabSize": 2
}
返回編輯皮膚,測試tab是否生效,如果沒有生效建議重啟軟體
相關文章
- TabError: inconsistent use of tabs and spaces in indentationError
- ORA-00923: FROM keyword not found where expected
- Android:Unexpected lock protocol found in lock file. Expected 3, found 0.AndroidProtocol
- 每日充電:踩坑expected ‘package‘, found ‘import‘PackageImport
- PyTorch出現錯誤“RuntimeError: Found dtype Double but expected Float”PyTorchError
- Go 執行 程式 test.go:1:1: expected ‘package‘, found ‘EOF‘GoPackage
- 全新 14 英寸和 16 英寸 MacBook Pro 首次亮相Mac
- 14 英寸或 16 英寸 MacBook Pro如何充電Mac
- E. Expected Power
- A Tomcat 8.0 installation is expectedTomcat
- Error-Expected resource of typeError
- Python IndentationError: expected an indented blockPythonErrorBloC
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces
- Vue : Expected the Promise rejection reason to be an ErrorVuePromiseError
- pytorch 踩坑,TypeError: expected seqence object with len>_0 or a single integer_typeerror: expected sequence object with len __ 0PyTorchErrorObject
- CentOS載入yum源時報錯 [Errno 14] HTTP Error 404 - Not Found Trying other mirror.CentOSHTTPError
- 好用的expected_conditions模組
- 16 寸MacBook Pro比14 寸風扇更強大,更耐用Mac
- 據說,2021年Apple將推出14&16英寸MacBook ProAPPMac
- -bash: id: command not found -bash: tty: command not found
- kubeadm not found
- 先睹為快,即將上市的16英寸和14英寸MacBook ProMac
- nodemon: command not found
- pip: command not found
- found an invalid color
- iOS14將於太平洋時間9月16日正式釋出iOS
- xcode6編譯錯誤,提示Expected a typeXCode編譯
- [PHP 原始碼] EXPECTED 和 UNEXPECTED 到底是啥?PHP原始碼
- mac mysql: command not foundMacMySql
- zsh:command not found: xxx
- Spaces SDK:專為實時協作功能開發設計的SDK
- 論文解讀(DCN)《Towards K-means-friendly Spaces: Simultaneous Deep Learning and Clustering》
- TypeError: TF_SessionRun_wrapper: expected all values in input dict to be ndarrayErrorSessionAPP
- No qualifying bean of type 'javax.sql.DataSource' available: expected at least 1BeanJavaSQLAIAST
- gipchaLowerProcessNode: no valid interfaces found to node
- /bin/sh: 1: pahole: not found
- vue 踩坑-This dependency was not foundVue
- Newline required at end of file but not foundUI