vs code+uniapp+vue3+vite+typescript+pinia開發

//–save-dev 會把 eslint 安裝到 package.json 文件中的 devDependencies 屬性中,僅開發時用到,生產不需要  
npm install eslint --save-dev
//https://eslint.bootcss.com/docs/user-guide/getting-started

‘module’ is not defined,解決:打開.eslintrc.js

  "env": {
       "browser": true,
       "es2021": true,
       "node": true,
   },

Parsing error: '>' expected.eslint,解決:打開.eslintrc.js

    "parser": "vue-eslint-parser",
    "parserOptions": {
        "parser": "@typescript-eslint/parser",
    },

Component name "index" should always be multi-word.eslint,解決:打開.eslintrc.js

    "rules": {
        //關閉組件命名規則
        "vue/multi-word-component-names": "off",
    },

 Unexpected any. Specify a different type.eslint,解決:打開.eslintrc.js

    "rules": {
        //關閉組件命名規則
        "@typescript-eslint/no-explicit-any":"off",
    },

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章