-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 VSCode 中写 .mina 文件有没有办法配合 prettier 自动格式化 #5
Comments
参考: |
自动格式化的话,VSCode 里用 Vetur + Prettier + EditorConfig 可以解决你的问题吗? |
另外如果项目里有使用 TypeScript 的话,@jimexist 的 |
@imyelo 谢谢
// prettier.config.js
module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: false,
parser: "vue"
}
// .eslintrc.js
module.exports = {
extends: ['plugin:vue/recommended','prettier',"prettier/standard"],
plugins: ["vue", "prettier"],
rules: {
'vue/attribute-hyphenation': 0,
'vue/valid-template-root': 0,
'vue/comment-directive': 0,
"prettier/prettier": "error"
},
parserOptions: {
sourceType: "module",
parser: "babel-eslint"
},
env: {
browser: true
},
} 大致上实现了想要的效果。不过还存在一些缺陷:
|
参考 https://github.com/eslint/typescript-eslint-parser 来配置 eslint |
vcode 直接将 mina 文件名以 vue形式进行检查 "files.associations": {
"*.mina": "vue"
},
` |
vetur 的问题持续有一段时间了:#59 , 手动加 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在 VSCode 中下载了 Vetur 来使得 .mina 文件高亮,
<template>
<script>
以及<style>
部分都解决了高亮问题,<config>
部分一直没有高亮。此外,自动格式化效果一直不如人意,有些影响开发效率,请问有没有合适的mina格式化方案推荐。
The text was updated successfully, but these errors were encountered: