美文网首页H5-vue学习
vue项目.prettierrc文件配置 error:Stri

vue项目.prettierrc文件配置 error:Stri

作者: wodeph | 来源:发表于2021-09-27 14:48 被阅读0次

Module Warning (from ./node_modules/eslint-loader/index.js):

error:Strings must use singlequote(quotes) at src/store.js:1:17:

> 1 | import Vue from "vue"

    |                ^

  2 | import Vuex from 'vuex'

  3 | Vue.use(Vuex)

  4 | export default new Vuex.Store({

error:Expected indentation of 2 spaces but found 4(indent) at src/store.js:5:1:

  3 | Vue.use(Vuex)

  4 | export default new Vuex.Store({

> 5 |    state: {

    | ^

  6 |

  7 |    },

  8 |    mutations: {

error:Expected indentation of 2 spaces but found 4(indent) at src/store.js:7:1:

   5 |    state: {

   6 |

>  7 |    },

     | ^

   8 |    mutations: {

   9 |

  10 |    },

error:Expected indentation of 2 spaces but found 4(indent) at src/store.js:8:1:

   6 |

   7 |    },

>  8 |    mutations: {

     | ^

   9 |

  10 |    },

  11 |    actions: {

Prettier配置

作用:自定义代码格式

我这边是因为没有安装 Prettier,所以才报错的,安装 npm i prettier -g

{

  "semi": false,

  "singleQuote": true

}

使用快捷键:alt + shift + f  整理代码

相关文章

网友评论

    本文标题:vue项目.prettierrc文件配置 error:Stri

    本文链接:https://www.haomeiwen.com/subject/fznhnltx.html