如何在Nuxt.js中实现流程类型

编程入门 行业动态 更新时间:2024-10-28 14:26:26
本文介绍了如何在Nuxt.js中实现流程类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前正在尝试将现有的vue.js项目转换为nuxt.js.我无法在nuxt.js中添加流类型支持.当我运行流服务器时,它说没有错误!但运行npm run dev时,它会在流语法上引发错误.

I am currently trying to convert our existing vue.js project into nuxt.js. I am unable to add flowtype support in nuxt.js. when i run the flow server it says no errors!! but running npm run dev, its throwing error on the flow syntax.

.flowconfig [include] pages/**/.* components/**/.* layouts/**/.* apiRoutes/.* store/.* utils/.* [ignore] .*/build/.* .*/config/.* .*/dist/.* .*/node_modules/.* .*/static/.* .*/test/.* .*/ssl/.* .*/.nuxt/.* [libs] ./flow/ [options] emoji=true module.file_ext=.vue module.file_ext=.js server.max_workers=3 log.file=./flow.log suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe unsafe.enable_getters_and_setters=true module.system.node.resolve_dirname=node_modules module.name_mapper='^.*\.css$' -> 'empty/object' module.name_mapper='^.*\.js$' -> 'empty/object' module.name_mapper='^@/\(.*\)$' -> '<PROJECT_ROOT>/\1'

我添加了所有必要的babel和eslint软件包.

i've added all the neccessary babel and eslint packages.

.babelrc { "presets": [ ["env", { "modules": false }], "stage-2", ["es2015", {"modules": false }], "flow-vue" ], "plugins": [ "transform-runtime", "transform-class-properties", "syntax-flow", "transform-flow-strip-types" ], "comments": false, "env": { "test": { "presets": ["env", "stage-2"], "plugins": [ "istanbul" ] } } }

.eslintrc.js module.exports = { root: true, parserOptions: { parser: 'babel-eslint', sourceType: 'module' }, env: { browser: true, node: true, jquery: true }, extends: [ 'standard', 'plugin:flowtype/recommended' // 'plugin:vue/recommended' ], // required to lint *.vue files plugins: [ 'html', 'flowtype-errors', 'flowtype' ], // add your custom rules here rules: { 'flowtype-errors/show-errors': 2, // allow paren-less arrow functions 'arrow-parens': 0, 'semi': ["error", "always"], // allow async-await 'generator-star-spacing': 0 }, globals: {} }

在运行npm run dev时,它不会解析流类型语法

On running npm run dev, it doesnt parse flowtype syntax

推荐答案

我建议按照上的说明进行操作流程网站以设置Babel.特别是有一个预设,因此您无需配置单个规则.然后,您实际上需要运行Babel(同样,说明在网站上).运行Babel之后,您应该能够运行它在Node中输出的代码.

I suggest following the instructions on the flow website to set up Babel. In particular there is a preset, so you shouldn't need to configure individual rules. Then you'll actually need to run Babel (again, instructions are on the website). Once you have run Babel, you should be able to run the code it outputs in Node.

更多推荐

如何在Nuxt.js中实现流程类型

本文发布于:2023-07-16 04:22:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117787.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:流程   类型   如何在   js   Nuxt

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!