jaredpalmer / tsdx

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

Use compatible eslint-config-react-app and eslint-plugin-react-hooks. #890

Closed ludofischer closed 3 years ago

ludofischer commented 3 years ago

This solves the following warning on yarn install

eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-react-hooks@1.x".

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/formium/tsdx/3twdnlppk
✅ Preview: https://tsdx-git-3daf4c332f653210646bdb8fbc47852ba32b5f9a.formium.vercel.app

ludofischer commented 3 years ago

I guess this is a breaking change for people who relied on the previous React hooks lint rules.

agilgur5 commented 3 years ago

Yeaaa, it's probably breaking, but I'm not really sure why eslint-config-react-app didn't release a breaking change for it, it seems to change the rules in patches and minors per the changelogs 😕 There's also no individual changelog for this package in its directory.

Per the milestone added here and my comments in #889 , I was planning to release all the ESLint and Prettier upgrades as one breaking change together.

agilgur5 commented 3 years ago

Ah, here's what the v5.2.1 peerDeps look like, which explains both the current warning and the lack of warnings. All the other changes (including addition of eslint-plugin-jest) seem to have been made after v5.2.1 and I guess not yet released?

EDIT: yes, they're only updated in the current pre-release line, @next

ludofischer commented 3 years ago

In light of the discussion in #634 I wonder if it would not be better in the future to inline eslint rules into tsdx own config. That way it would not be forced to wrangle with dependency combinations which in this case are somewhat arbitrary (as package versions reflect rule changes more often than compatibility with eslint versions). Also you would have more control over which new warnings to introduce.

agilgur5 commented 3 years ago

I'm not sure that would really solve anything and may make TSDX actually have to make more breaking changes, because most rule changes (at least those to errors) are breaking. I also personally don't want to have to wrangle with opinionated rules, the feedback therein, etc -- folks who make configs already deal with that and I'd prefer to use their work instead of adding more work for myself (which is already plenty). Better to make things more maintainable instead of less maintainable

agilgur5 commented 3 years ago

@allcontributors please add @ludofischer for code

allcontributors[bot] commented 3 years ago

@agilgur5

I've put up a pull request to add @ludofischer! :tada: