kraftvaerk / generator-rammevaerk

Scaffold a web project in kraftvaerk style
MIT License
5 stars 4 forks source link

Error 'key' is defined but never used - no-unused-vars #45

Closed rammi987 closed 5 years ago

rammi987 commented 5 years ago

const obj = { a: 5, b: 7, c: 9 }; Object.entries(obj).forEach(([key, value]) => { console.log(${value}); // "a 5", "b 7", "c 9" });

This follow code above is valid in ES6, but the eslint complaning about unused.

kristoforsalmin commented 5 years ago

Hi @rammi987,

We can certainly think about how we want to handle unused arguments, but in your case you can simply use Object.values(obj) instead 😄

In general, ESLint issues aren't directly related to the generator itself, so we should probably keep those in kraftvaerk/eslint-config-kraftvaerk.

rammi987 commented 5 years ago

@racse1 you are right kraftvaerk/eslint-config-kraftvaerk is the correct place for this issue, my bad.