问题描述
每当我将一些参数传递给另一个文件中的函数时,Intellisense 就会停止工作。
解决方法
您需要定义您的智能感知 - 在这种情况下,没有定义或强制执行 initiatedBy
需要的类型。它应该是一个 User
但这不是强制的,所以类型是 any
。
要在 VSCode 中定义类型,请使用双星号注释:
/**
* What your function does should be here.
* @param {this should be the type of your param} nameOfParameter
* @param {Discord.User} initiatedBy
* @return {return type}
*/
const mainCreator = async (client,serverId,requestedUser,initiatedBy) => {}
请注意,这不会强制执行任何类型检查,它只会更新智能感知。