Closed EVINK closed 10 months ago
另外求问,除了使用prettier之外,有没有比较方便跨编辑器统一代码风格的模块?
我把prettier降级到 1.16.2 就可以用了,原因是 prettier 用到了node 10 以后才支持的 for await 语法。但我还是很疑惑,因为我本地的node版本有且只有一个v12.19.0的,是不是因为uni-app自身携带了一个低版本的node?
注意不要把 prettier 降级到 1.15.2 版本,将会导致另外一个错误
很重要啊,快点解决,
我也遇到同样的问题,自己安装的 Node 版本是支持 for await ... of
语法的,引入 Prettier 后在 HBuilderX 打开构建就失败。
vue.config.js
里面加上下面的配置可以解决vue模板下的问题,但是nvue模式下仍然报错
module.exports = {
chainWebpack: (config) => {
config.module
.rule('vue')
.use('vue-loader')
.tap((options) => {
options['prettify'] = false
return options
})
},
}
我把prettier降级到 1.16.2 就可以用了,原因是 prettier 用到了node 10 以后才支持的 for await 语法。但我还是很疑惑,因为我本地的node版本有且只有一个v12.19.0的,是不是因为uni-app自身携带了一个低版本的node?
注意不要把 prettier 降级到 1.15.2 版本,将会导致另外一个错误
很重要啊,快点解决,
已经解决了,降低 prettier 版本就行,mac 的 hx 自带了一个低版本的 node
@EVINK @SunSeekerX
问题描述 使用vue-cli 创建的项目 vue create -p dcloudio/uni-preset-vue gapp-v2
复现步骤 [复现问题的步骤]
package.json
.eslintrc.js
预期结果 不对开发模块(devDependencies)进行模块加载,并正确编译
实际结果
系统信息:
uni-app v2.8.13 uni-app cli v2.0.0-28920200927001
Environment Info:
System: OS: macOS 10.15.7 CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz Binaries: Node: 12.19.0 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.8 - /usr/local/bin/npm Browsers: Chrome: 86.0.4240.80 Firefox: 72.0.2 Safari: 14.0 npmPackages: @dcloudio/types: => 2.0.8 @dcloudio/uni-app-plus: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-app-plus-nvue: 0.0.1 @dcloudio/uni-app-plus-nvue-v8: 0.0.1 @dcloudio/uni-automator: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-cli-shared: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-h5: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-helper-json: => 1.0.6 @dcloudio/uni-migration: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-mp-360: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-mp-alipay: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-mp-baidu: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-mp-qq: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-mp-toutiao: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-mp-vue: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-mp-weixin: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-quickapp-native: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-quickapp-webview: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-stat: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/uni-template-compiler: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/vue-cli-plugin-hbuilderx: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/vue-cli-plugin-uni: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/vue-cli-plugin-uni-optimize: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/webpack-uni-mp-loader: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @dcloudio/webpack-uni-nvue-loader: 0.0.1 @dcloudio/webpack-uni-pages-loader: ^2.0.0-28920200927001 => 2.0.0-28920200927001 @hap-toolkit/dsl-vue: 0.6.13 @vue/babel-helper-vue-jsx-merge-props: 1.0.0 @vue/babel-helper-vue-transform-on: 1.0.0-rc.2 @vue/babel-plugin-jsx: 1.0.0-rc.3 @vue/babel-plugin-transform-vue-jsx: 1.1.2 @vue/babel-preset-app: 4.5.7 @vue/babel-preset-jsx: 1.1.2 @vue/babel-sugar-functional-vue: 1.1.2 @vue/babel-sugar-inject-h: 1.1.2 @vue/babel-sugar-v-model: 1.1.2 @vue/babel-sugar-v-on: 1.1.2 @vue/cli-overlay: 4.5.7 @vue/cli-plugin-babel: ~4.5.0 => 4.5.7 @vue/cli-plugin-router: 4.5.7 @vue/cli-plugin-typescript: * => 4.5.7 @vue/cli-plugin-vuex: 4.5.7 @vue/cli-service: ~4.5.0 => 4.5.7 @vue/cli-shared-utils: 4.5.7 @vue/component-compiler-utils: 3.2.0 (3.2.0) @vue/preload-webpack-plugin: 1.1.2 @vue/shared: ^3.0.0-rc.4 => 3.0.0 @vue/web-component-wrapper: 1.2.0 eslint-plugin-vue: ^7.0.1 => 7.0.1 mpvue-page-factory: 1.0.1 mpvue-template-compiler: 1.0.13 uni-h5-vue: 2.6.10 uni-mp-vue: 2.6.10 vue: ^2.6.11 => 2.6.12 vue-class-component: ^6.3.2 => 6.3.2 (7.2.6) vue-eslint-parser: 7.1.1 vue-hot-reload-api: 2.3.4 vue-loader: 15.9.3 (16.0.0-beta.8, 15.9.3) vue-property-decorator: ^8.0.0 => 8.5.1 vue-router: 3.0.1 vue-style-loader: 4.1.2 vue-template-compiler: ^2.6.11 => 2.6.12 (2.6.12) vue-template-es2015-compiler: 1.9.1 vuex: ^3.2.0 => 3.5.1 npmGlobalPackages: @vue/cli: 4.3.1