quavedev / eslint-plugin

6 stars 2 forks source link

TS Support #10

Closed matheusccastroo closed 5 months ago

matheusccastroo commented 5 months ago

This PR adds support to the walker for parsing ts and tsx files. It also add a flag to ignore the cache.

The way to support typescript is to simply compile it before parsing it with babel.parse with the typescript compiler. We can't really use the babel typescript plugin/preset because it can still cause compilation errors and it would conflict with the flow plugin that comes from the babel options from reify.

We also added the flag METEOR_ESLINT_PLUGIN_IGNORE_CACHE to allow the user to ignore or not the cache. This is needed because there seems to be a race condition between the 2 rules that uses the walker, and the end result is the cache file empty. I think this happens only in larger projects because ESLint might run the rules concurrently. I tested with the TS meteor sample and it worked with the cache without a problem.