orbit icon indicating copy to clipboard operation
orbit copied to clipboard

Apply same ESLint rules to TypeScript files as well

Open silvenon opened this issue 4 years ago • 5 comments

Currently our ESLint config for JavaScript (Flow) and TypeScript are strictly separated, but when we start adding TypeScript files at some point in the future, we want to have the same ESLint support as we did for Flow files. We should extract the common parts of the configuration and eslintJS.js and eslintTS.js should strictly contain config related to Flow and TypeScript respectively, while everything else should be in eslintCommon.js that both would extend.

silvenon avatar Oct 15 '20 07:10 silvenon

Hi, I think I can help you with this!

yencolon avatar Oct 20 '20 04:10 yencolon

That would be very much appreciated! Let me know if you need any help 😉 The configs have most likely diverged significantly, so when in doubt, prefer the rules that are in eslintJS.js.

silvenon avatar Oct 20 '20 11:10 silvenon

Of course, assign this to me 👍

yencolon avatar Oct 20 '20 13:10 yencolon

Hi @silvenon, I'm currently working on this, but I am a little bit confused, the issue description says that there's 'a lot of repetition' in both files, but I don't see it. Maybe I did not get the main idea. Can you help me?

yencolon avatar Oct 23 '20 05:10 yencolon

That's true, it's kinda standalone currently, but try applying to it everything that isn't specifically Flow-related so we see what happens. When we start adding TypeScript files at some point in the future, we want to have the same ESLint support as we did for Flow files.

silvenon avatar Oct 23 '20 09:10 silvenon