jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.26k stars 508 forks source link

Separate out an ESLint Shareable Config package #801

Closed zenflow closed 4 years ago

zenflow commented 4 years ago

Current Behavior

Sometimes I want to use tsdx's wonderful eslint configuration, but don't need the other functions of tsdx (build & test), for whatever reason (see comment https://github.com/formium/tsdx/issues/634#issuecomment-673735730 for specific examples).

One way to do this is to just install the whole tsdx package but that will come with a large volume of unused dependencies.

Another way to do it is to just use eslint-config-tsdx, an eslint shareable config with the rules of tsdx. This way we don't get the large volume of unused dependencies, but that package (right now) just mirrors the configuration that lives in tsdx, and the two can become out-of-sync.

Desired Behavior

  1. I would like to be able to install and use just the eslint configuration from tsdx, without the added weight of the other parts of tsdx (build & test).

  2. I would also like to be sure I'm using the same eslint configuration in this scenario as when using tsdx itself.

Suggested Solution

My proposed solution is simply to use eslint-config-tsdx (an eslint shareable config with the rules of tsdx, as mentioned above) here, in the extends field of the generated eslint config. This way we can achieve both things listed under "Desired Behavior".

See https://github.com/formium/tsdx/issues/634#issuecomment-673736473 for a more detailed/verbose description of my proposed solution.

I will put my proposed solution into the form of a PR to make it perfectly clear.

Who does this impact? Who is this for?

This is for users who want to use tsdx's linting functionality without using tsdx's other functionalities. This should only impact them; other users should not be impacted at all besides getting a simplified (but equivalent) output from tsdx lint --write-file.

Describe alternatives you've considered

Some options are described above (under Current Behavior) but have their drawbacks.

Additional context

The use case for this feature is originally described here: https://github.com/formium/tsdx/issues/634#issuecomment-673735730

agilgur5 commented 4 years ago

Duplicate of #634 ... Please don't knowingly make duplicate issues, they confuse people and unnecessarily take more time to respond to...