Closed AntonioVentilii-DFINITY closed 1 week ago
@peterpeterparker note that the new plugin does not seem to be so well maintained (last version 4 years ago). However there is not much to mantain except bumping dependencies.
There is an alternative with this other plugin that is a fork actually and seems more recent: https://www.npmjs.com/package/eslint-plugin-prefer-arrow-functions
What would you suggest?
Do we need the plugin? Maybe the rules already cover enough use cases at least to get started?
I checked and it would have not raised any issues, without that plugin, in this repo. What I can do is to create a "simpler" rule like the one provided in the new plugin but limited to our usage
I see. Sounds cool to me if you think it makes sense? Your call.
So, update here, @peterpeterparker :
I tried to create our own rule, trimming the one provided by those library. But it is basically an entire copy/paste minus 10/15 lines (over 350 lines total)...
So, I think it is ok to use the library we are currently using (it had more than 1 million download in the last week), and we can always replace it with our own code in the future, IF and WHEN the time arrives.
WDYT?
Thank you for contributing! Unfortunately this repository does not accept external contributions yet.
We are working on enabling this by aligning our internal processes and our CI setup to handle external contributions. However this will take some time to set up so in the meantime we unfortunately have to close this Pull Request.
We hope you understand and will come back once we accept external PRs.
— The DFINITY Foundation"""
Motivation
To further help with enforcing the arrow functions we add two rules and one plugin. This is one of the most suggested combination I found online:
function foo() {...}
function
.Changes
Tests
The rules raised some new issues on this repo and we fixed them.