我不知道如何为函数括号之间的空间设置配置。我已经设置了处处为 true,但是当我保存.vue文件时,该空间被删除 - 删除后,它会突出显示为错误 ( Missing space between function parentheses)。它发生在script部分。在.js文件空间被添加,但也突出显示为错误,这一次... Unexpected space between function parentheses?!在保存空间时,有一些设置配置(我现在无法重新创建),然后在.vue文件中再次删除了空间。
我的设置.json
"vetur.format.defaultFormatter.js": "prettier", // tried both prettier and typescript
// "vetur.format.defaultFormatter.js": "vscode-typescript", // tried both prettier and typescript
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true,
"spaceBeforeFunctionParen": true,
"eslintIntegration": true,
},
"vscode-typescript": {
"singleQuote": true,
"spaceBeforeFunctionParen": true,
"eslintIntegration": true,
}
},
Run Code Online (Sandbox Code Playgroud)
.eslintrc.js
module.exports = {
root: true, …Run Code Online (Sandbox Code Playgroud) 对于我的一个存储库,GitKraken 显示此警告消息:“此存储库具有 Git 钩子。在 Windows 上使用 Git 钩子需要 sh.exe,但 GitKraken 找不到它。”
有关系吗?如何让 GK 找到这个 sh.exe 文件?或者如何解决这个问题?
我对 Lua 如何处理函数参数中的对象引用有点困惑。考虑这个例子:
local tableA = {name = "A"}
local tableB = {name = "B"}
local tableC = {name = "C"}
local function childA(a, b)
a = tableC
b.name = "This works"
end
local function childB(a, b)
print("a =", a.name) -- expected to print "C"
print("b =", b.name) -- prints "This works" as expected
end
local function parentFunction(a, b)
childA(a, b)
childB(a, b)
end
parentFunction(tableA, tableB)
Run Code Online (Sandbox Code Playgroud)
我希望在childA函数中a参数将被替换为引用,从现在开始tableC将继续如此tableC,但它不会发生。然而,如果我仅更改参数中此类参数的属性,b它将影响对对象的读取。为什么覆盖不能像这样工作?