Gelio / tslint-react-hooks

TSLint rule for detecting invalid uses of React Hooks
MIT License
218 stars 10 forks source link

Integrate this to tslint-react #8

Closed jukben closed 5 years ago

jukben commented 5 years ago

Hey! 👋

Thank you for great work, what do you think about to contribute this to tslint-react? https://github.com/palantir/tslint-react/issues/186

Gelio commented 5 years ago

Hey 👋 I am all for it 👍 Actually, I was planning on making a PR today 😄

I am unsure whether https://github.com/palantir/tslint-react will accept it, though, as it will be the first external dependency with a rule that will be added to that repository 😄 We will see, though

Gelio commented 5 years ago

I have just filed a PR: https://github.com/palantir/tslint-react/pull/204 🎉

karfau commented 5 years ago

Hey there, I agree it would make sense, but since over there there doesn't seem to be not to much progress (as is also the case with other PRs there) I think it would be nice to just add the compiled rules to a dist folder in the repo (or do that with a postinstall hook maybe?) and providing a tslint.json to point to that directory. This way your awesome rules can already be used directly from your github repo.

Since I would love to integrate your rules into https://github.com/bettermarks/bm-tslint-rules without relying on tslint-react to land your PR, that would help lot.

Any questions or comments on that topic are welcome!

Best Christian

Gelio commented 5 years ago

@karfau I am not sure if I understood you correctly 🙂 This project can already be installed on its own without tslint-react. The instructions are in the README. After installing and adding the project name in extends in tslint.json and specifying the rule severity (also in tslint.json), the rule should automatically work and apply in your code.

The rules are compiled just before they are published to npm. Try running npm install tslint-react-hooks and inspect the directory in node_modules. You will see that it looks slightly different than this repository

Adding this project to tslint-react could only make it more popular and more frequently downloaded, nothing else 🙂

karfau commented 5 years ago

Awesome! Don't know why I didn't realise it when scanning the README, I didn't check npm ... :stuck_out_tongue: ~Adding a badge to the readme might make it more obviious.~ Not sure what I looked at yesterday...

Gelio commented 5 years ago

Which badge do you have in mind :smile:? The readme currently contains badges for the number of downloads and the latest version published to npm :smile:

karfau commented 5 years ago

I think it won't be long until we will make use of it then. bettermarks/bm-tslint-rules#82

Gelio commented 5 years ago

Unfortunately, tslint-react wanted me to copy the implementation of this rule to their repo instead of adding it as a dependency. I would rather keep it in this repository so I can develop it freely. Therefore I am closing this PR :slightly_frowning_face: