Closed Dragonizedpizza closed 3 years ago
For key-value DBs, like enmap. Ik tchnically we could also get it from giveawayData, but that shouldn't matter much.
For key-value DBs, like enmap. Ik tchnically we could also get it from giveawayData, but that shouldn't matter much.
eslint throws an error for unused var
only if you view it through node_modules and have eslint enabled for that path (I think)
for package development there is 'no-unused-vars': 0
in the config file
only if you view it through node_modules and have eslint enabled for that path (I think) for package development there is
'no-unused-vars': 0
in the config file
I meant my eslint, when I'm extending the class
ahh yeah... I guess since we're breaking the db examples in v13 anyway, i guess i will remove it and use giveawayData.messageId
Or would it be to inconvinient to add a eslint disable comment? Since for sql dbs the key is, think, always/mostly required no? Im unsure
You can simply remove the param when extending the class right? It won't throw an error.
You can simply remove the param when extending the class right? It won't throw an error.
function(messageId, giveawayData)
Something has to be there right, so hdym "remove"?
You can simply remove the param when extending the class right? It won't throw an error.
discord-giveaways will still internally pass the messageId param, and the method would consider it as giveawayData
This code should be valid with eslint:
saveGiveaway (messageID, data) {
console.log(data);
// as the second argument was used, no error is thrown for the messageID param
}
Am I wrong?
yes, but the lib doesn't require the messageID param at all
also, the error was about messageID, not data, so console.log(messageID)
Nop, because if you use the second param (data), eslint will see that you have no other way than declaring messageID even if you don't use it
yeah I checked it myself right now, no error when 1st is not used but 2nd is.
@Dragonizedpizza did you add args: all
in your config? since only then would it error for me
nope
nope
weird, are you sure its not from some other rule maybe that you have customized?
I will close this for now since this seems to be coming from somewhere else/the devs own settings.
I will close this for now since this seems to be coming from somewhere else/the devs own settings.
but the messageId param is literally pointless
I will close this for now since this seems to be coming from somewhere else/the devs own settings.
but the messageId param is literally pointless
it's more readable than referencing from the object i guess. => more practical in a way. As said key-value, and most of the db examples use it.
Ik it is a little out of place in the default (json) functions, but I guess Androz thought into the future or smth. EDIT: yeah exactly that, the commit is named so: https://github.com/Androz2091/discord-giveaways/commit/f1d1878df74c9376057ff729733d0b6b6ee55d7b = key-value was intended
https://github.com/Androz2091/discord-giveaways/blob/master/src/Manager.js#L387 Why is the messageID param in there, even though its not used?