Skip to content
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

Remove explicit return types rule #5070

Closed
wants to merge 2 commits into from

Conversation

hannahblair
Copy link
Collaborator

Description

I'm proposing we remove eslint's explicit function return types rule. We have quite a few of these errors around our repo (e.g Dataset.svelte) but can't fix these if the function is inline because Svelte can't parse non-standard JS expressions in the markup of the file without adding an external transpiler into the mix, it can only do so in the <script />. The only way of resolving the error is moving the func to the <script /> but this isn't ideal, and I think we should just remove this rule to tidy up our errors. This is a known limitation. Also a discussion around it here.

Open to discussion around this!

Screenshot 2023-08-02 at 15 18 12

@hannahblair hannahblair requested a review from pngwn August 2, 2023 13:19
@vercel
Copy link

vercel bot commented Aug 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
gradio ✅ Ready (Inspect) Visit Preview Aug 2, 2023 1:20pm

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Aug 2, 2023

🎉 Chromatic build completed!

There are 4 visual changes to review.
There are 0 failed tests to fix.

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Aug 2, 2023

🦄 no changes detected

This Pull Request does not include changes to any packages.

__No changes detected. __

  • Maintainers can select this checkbox to manually select packages to update.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can create the changelog file directly.

@gradio-pr-bot
Copy link
Collaborator

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-5070-all-demos


You can install the changes in this PR by running:

pip install https://gradio-builds.s3.amazonaws.com/de33e05de51b191512ca6b8a1bbe81a15c05a98f/gradio-3.39.0-py3-none-any.whl

@pngwn
Copy link
Member

pngwn commented Aug 2, 2023

We don't need to remove the rule, just play with the options I've fixed this in #5074 by tweaking this rule:

"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true }
],

@hannahblair
Copy link
Collaborator Author

Oh great! Thanks, I'll close this PR.

@hannahblair hannahblair closed this Aug 3, 2023
@hannahblair hannahblair deleted the remove-explicit-return-types-rule branch October 18, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants