admin管理员组文章数量:1430645
Reading the code of Vue.js I found this:
function isPrimitive (value) {
return (
typeof value === 'string' ||
typeof value === 'number' ||
// $flow-disable-line
typeof value === 'symbol' ||
typeof value === 'boolean'
)
}
What is the purpose of the // $flow-disable-line ment? Does it alter in any way the evaluation?
Reading the code of Vue.js I found this:
function isPrimitive (value) {
return (
typeof value === 'string' ||
typeof value === 'number' ||
// $flow-disable-line
typeof value === 'symbol' ||
typeof value === 'boolean'
)
}
What is the purpose of the // $flow-disable-line ment? Does it alter in any way the evaluation?
Share Improve this question asked Mar 18, 2018 at 21:13 mzcarlosmzcarlos 2213 silver badges12 bronze badges 1-
3
A google search for
$flow-disable-line
indicates that it disables Flow JS error reporting on the following line. – Pointy Commented Mar 18, 2018 at 21:14
1 Answer
Reset to default 6What is it
You will notice in the repo that there is a .flowconfig with the following option:
suppress_ment= \\(.\\|\n\\)*\\$flow-disable-line
Which seems to be a way to disable errors for the next line in Flow JS
Why does Vue use it
From flows documentation:
Symbols are not currently supported by Flow. You can see these two issues for more information (see link)
So since flow doesn't support symbols, and vue needs to utilize symbols, it only makes sense to disable errors on the line using them.
Hope this helps!
本文标签: vuejsjavascript What is a flow disable lineStack Overflow
版权声明:本文标题:vue.js - javascript: What is a flow disable line? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745489521a2660540.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论