lynt icon indicating copy to clipboard operation
lynt copied to clipboard

Avoid installing extra packages

Open danielpza opened this issue 7 years ago • 1 comments

In a typescript project the eslint dependencies are not needed and vice versa. I mostly use lynt for typescript and don't want to have extra dependencies even on development, the eslint configurations files are not that bad, but it also includes babel-eslint wich includes its own packages like babel-parser. Would you consider adding an option to prevent adding eslint packages for typescript project.

I was thinking of making two extra package, lynt-ts and lynt-js, so you can opt out of using eslint in typescript projects, like

# for typescript
$ npm i lynt lynt-ts

# for js
$ npm i lynt lynt-js

I know this is an extra step but it is a short one

danielpza avatar Nov 06 '18 03:11 danielpza

Hey @danielpa9708, very sorry about the delay in my response. I've been away for a bit, but should now have some more time to continue work on open-source stuff.

When I first created the project, I had been considering making lynt and tslynt as two separate projects, mainly due to the huge size of babel-eslint, which as you mention is a really big package for TypeScript users who won't even be using it. I ended up deciding not to go that way for "simplicity" and to just make life easier regardless for js/flow/react/ts users.

Nowadays, I'm pretty much all-in on TypeScript, so I definitely feel the pain a lot more. I think I agree with you in that we should be able to opt-in out of eslint/babel stuff.

So there's two ways we could probably do this.

  1. Your approach:
# for typescript
$ npm i lynt lynt-ts

# for js
$ npm i lynt lynt-js

2: Lynt becomes something you should install globally, and then you run lynt --init to set it up for a specific project, which installs all the necessary packages you will need

# for typescript
$ lynt --init --typescript

# for js
$ lynt --init

I think I'm leaning more towards your approach. I'll look into implementing this soon, unless I get some other feedback on alternative suggestions.

saadq avatar Nov 27 '18 04:11 saadq