github Rel1cx/eslint-react v1.21.0

latest releases: v1.53.1, v1.53.0, v1.52.9...
8 months ago

What's Changed

✨ New

  • feat(plugins/hooks-extra): add no-useless-custom-hooks rule by @Rel1cx

🪄 Improvements

  • refactor(plugins/hooks-extra): deprecate rule no-redundant-custom-hook in favor of no-useless-custom-hooks (the previous rule will still be available until the next major update to avoid breaking changes)
  • docs: document active rules, closes #830 by @Rel1cx in #882
  • docs: add setup instructions and example to pure JS project, closes #844 by @Rel1cx in #885

📝 Changes in Rule implementation

no-useless-custom-hooks now detects Hook calls within comments and the following code no longer triggers a warning:

// ✅ Good: A Hook that will likely use some other Hooks later
function useAuth() {
  // TODO: Replace with this line when authentication is implemented:
  // return useContext(Auth);
  return TEST_USER;
}

Full Changelog: v1.20.1...v1.21.0

Don't miss a new eslint-react release

NewReleases is sending notifications on new releases.