-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESLint rules that analyze return
are broken.
#90
Comments
OK, so the reason this is happening is that the linter is unaware of LightScript's implicit returns. So that rule thinks the function is returning nothing, which is a violation. There are two paths forward to fixing this:
Both paths have their ups and downs:
The question is which way to go. (1) is definitely more appealing to me as a sole maintainer here, but I know what kinds of problems it can bring from past experience mutilating the AST that's passed into eslint. Re (2), There actually aren't a lot of rules in the core eslint suite that need to be modified, and yours is the first instance of an external rule so far, so I wouldn't totally write (2) off yet. |
Hmm, the downsides of both of those options don't seem that great. Perhaps you should have the same approach you did before and just say: well there are just some eslint rules/plugins that don't work with LightScript? For this particular case I'm ok with forking |
Because of #97, I'm basically forced into pursuing option (1) here and hoping that not too many style rules are impacted. So that's the plan. |
This also breaks |
return
are broken.
- Disable `array-callback-return` - Disable `react/require-render-return` - Monkeypatch `fp/no-nil` Re wcjohnson/lightscript#90
So after a lot of work, I've found approach 1 is basically a non-starter. Therefore, addressing this via approach 2. I've added a commit that fixes all the documented cases so far, and I'm leaving this issue open for ongoing contributions of new issues regarding implicit |
I may have found another one relating to noop's. The following code causes the
https://eslint.org/docs/rules/no-unreachable Oddly enough if you change the Changing the |
With the following code I get an error with the fp/no-nil plugin. It says that the map function is returning undefined.
I'm not 100% certain this is a lightscript issue though, as I have only just started using the eslint-plugin-fp plugin.
This is what I have installed:
My eslint config file:
The text was updated successfully, but these errors were encountered: