[英]Difference eslint between 'prettier/vue' and '@vue/prettier'
Lately I was working on a vue3/vite + ts project and wanted to add eslint and prettier, but I'm getting confused what settings I should use in the eslint file(section "extends") and/or how to spell them.最近我在做一个 vue3/vite + ts 项目,想添加 eslint 和更漂亮,但我很困惑我应该在 eslint 文件中使用哪些设置(“扩展”部分)和/或如何拼写它们。 If I look at the official eslint vue homepage , they write the prettier stuff like the not commented out lines(picture below).But if I look at the official eslint-config-typescript page they write it like the commented out lines(picture below).
如果我查看官方 eslint vue 主页,他们会写更漂亮的东西,例如未注释掉的行(下图)。但是如果我查看官方 eslint-config-typescript 页面,他们会像注释掉的行一样写(下图) )。 And if I google I find both examples in projects.
如果我用谷歌搜索,我会在项目中找到这两个例子。 So my question is:
所以我的问题是:
Is there any difference between the writing?写的有区别吗? Or do they do the same and it doesn't matter which one I take?
还是他们做同样的事情,我拿哪一个都没关系?
I don't know much about vue3/vite + ts, but I see here 2 moments:我对 vue3/vite + ts 了解不多,但我在这里看到了 2 个时刻:
@
. @
的用法。 It is likely to be related to webpack (I believe you use vue-cli).resolve: {alias: {'@': path.resolve('src')}},
So, @
is just an alias for some path in your system, usually root/source folder for your project.resolve: {alias: {'@': path.resolve('src')}},
所以, @
只是系统中某个路径的别名,通常是项目的根/源文件夹. You can find the exact path in webpack.config.js
.webpack.config.js
中找到确切的路径。vue/prettier
vs prettier/vue
. vue/prettier
与prettier/vue
的对比。 Just location of the package.prettier
bundled with vue or a standalone prettier
package that contains some custom/adopted version for vue.prettier
的软件,也可以使用包含一些自定义/采用 vue 版本的独立prettier
的 package。 They are likely to be pretty much the same, check their package.json files for versions.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.