vue中eslint導(dǎo)致的報錯問題及解決
更新時間:2023年10月20日 10:13:09 作者:飛得更高肥尾沙鼠
這篇文章主要介紹了vue中eslint導(dǎo)致的報錯問題及解決方案,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
報錯信息
[plugin:vite-plugin-eslint] C:\git_project\xxxxxxxxx\src\views\station\info\InfoForm.vue
54:29 error Delete `?` prettier/prettier? 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
解決方案
修改.eslintrc.js文件

// @ts-check
const { defineConfig } = require('eslint-define-config')
module.exports = defineConfig({
root: true,
env: {
browser: true,
node: true,
es6: true
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
jsxPragma: 'React',
ecmaFeatures: {
jsx: true
}
},
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
'./.eslintrc-auto-import.json'
],
rules: {
'prettier/prettier': 'off',
"no-irregular-whitespace": "off",
'vue/script-setup-uses-vars': 'error',
'vue/no-reserved-component-names': 'off',
.......
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
// 'no-unused-vars': 'error',
"no-unused-vars": 'off',
'space-before-function-paren': 'off',
.......
'vue/multi-word-component-names': 'off'
}
})
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- Vue3配置路由ERROR in [eslint]報錯問題及解決
- vue?eslint報錯error?"Component?name?"*****"?should?always?be?multi-word"解決
- vue?eslint報錯:Component?name?“xxxxx“?should?always?be?multi-word.eslintvue的4種解決方案
- vue-cli創(chuàng)建項目時由esLint校驗導(dǎo)致報錯或警告的問題及解決
- vue關(guān)于eslint空格縮進等的報錯問題及解決
- vue?cli2?和?cli3去掉eslint檢查器報錯的解決
- vue項目下,如何用命令直接修復(fù)ESLint報錯
相關(guān)文章
vite項目添加eslint?prettier及husky方法實例
這篇文章主要為大家介紹了vite項目添加eslint?prettier及實例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-07-07
vue-drawer-layout實現(xiàn)手勢滑出菜單欄
這篇文章主要為大家詳細介紹了vue-drawer-layout實現(xiàn)手勢滑出菜單欄,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2020-11-11

