我正在尝试使用eslint和Vue.js / Nuxt.js为模板和脚本设置Flowtype。
我安装了流程,我在Atom得到了很好的反馈,包括来自flow和eslint(yay)和更漂亮的原子,就像一个魅力...经过几个小时的尝试,因为我从来没有真正玩过那些。
现在我想知道是否:
1)我错过了配置
2)可以使用配置或包在我的Vuejs中使流不报告Unexpected token @
3)如果我的@click="something"
函数正常(例如规则),或者data()
中的变量从未用于"devDependencies": {
"babel-eslint": "^8.2.3",
"eslint-plugin-flowtype": "^2.46.3",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"eslint": "^4.19.1",
"eslint-config-vue": "^2.0.2",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-flowtype-errors": "^3.5.1",
"eslint-plugin-html": "^4.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-vue": "^4.5.0",
"prettier": "^1.12.1",
"prettier-eslint": "^8.8.1"
},
,是否可能使Atom / eslint / flow报告错误模板或脚本等
作为参考,我首先设法使一切工作更漂亮 - 原子,现在我正在尝试添加Vue / Nuxt支持。我按照this link进行了设置。
devDependencies:
root: true,
"parser": "babel-eslint",
"plugins": [
"html",
"flowtype",
"prettier"
],
settings: {
flowtype: {
onlyFilesWithFlowAnnotation: false
}
},
"extends": [
"vue"
],
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
unicodeCodePointEscapes: true,
globalReturn: true,
jsx: true
}
},
"globals": {
"axios": true
},
"env": {
"browser": true,
"node": true,
"commonjs": true,
"es6": true
},
eslintrc:
{
"plugins": [
"babel-plugin-transform-class-properties",
"babel-plugin-syntax-flow",
"babel-plugin-transform-flow-strip-types"
]
}
我省略了规则,因为我在弄清楚我想要的东西时,我有所有的规则和描述。
babelrc:
<template>
<p>I'm made with Flow and a bunch of other cool stuff! {{ defined }}</p>
<a @click="actionDefined">Submit this {{ NotDefined }}.</a>
<a @click="actionUndefined">Looks like this one won't work.</a>
</template>
<script>
export default {
created() {
console.log(randomThing)
},
data() {
return {
defined: "boop!",
}
},
methods: {
async actionDefined() {
console.log("yay")
},
}
}
</script>
我的“测试”代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SeleccionarTesoro : MonoBehaviour {
public GameObject infotesoro0001A;
public GameObject infotesoro0002A;
public GameObject infotesoro0003A;
public GameObject infotesoro0004A;
public GameObject infotesoro0005A;
void Update() {
if (Input.GetMouseButtonDown (0))
{
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if (Physics.Raycast (ray, out hit))
{
if (hit.collider.gameObject.name == "tesoro_0001") {
infotesoro0001A.SetActive (true);
}
if (hit.collider.gameObject.name == "tesoro_0002") {
infotesoro0002A.SetActive (true);
}
if (hit.collider.gameObject.name == "tesoro_0003") {
infotesoro0003A.SetActive (true);
}
if (hit.collider.gameObject.name == "tesoro_0004") {
infotesoro0004A.SetActive (true);
}
if (hit.collider.gameObject.name == "tesoro_0005") {
infotesoro0005A.SetActive (true);
}
}
}
}
}
我真的很感谢你的帮助, 谢谢!