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

feat(eslint-plugin): allow explicit variable type with arrow functions #260

Open
wants to merge 8 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@gilbsgilbs
Copy link

gilbsgilbs commented Feb 12, 2019

Fixes #149

Not sure if this is really acceptable though. Please tell me if it has some edge cases I didn't see or if it's just too broad.

@codecov

This comment has been minimized.

Copy link

codecov bot commented Feb 12, 2019

Codecov Report

Merging #260 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
+ Coverage   97.24%   97.24%   +<.01%     
==========================================
  Files          67       67              
  Lines        2357     2361       +4     
  Branches      336      338       +2     
==========================================
+ Hits         2292     2296       +4     
  Misses         44       44              
  Partials       21       21
Impacted Files Coverage Δ
...-plugin/src/rules/explicit-function-return-type.ts 100% <100%> (ø) ⬆️
@bradzacher
Copy link
Member

bradzacher left a comment

Please add an example to the rule's readme so people can see this functionality without looking at the tests.

@typescript-eslint/core-team do we want to put this behind a setting (default on) in case people don't want to "trust" type annotations?
I.e. might not trust them because the following case passes:

type X = Function;
const x: X = () => 1;

@gilbsgilbs gilbsgilbs force-pushed the gilbsgilbs:explicit-variable-type-arrow-function branch from 3ec706f to a9df636 Feb 12, 2019

@gilbsgilbs

This comment has been minimized.

Copy link
Author

gilbsgilbs commented Feb 12, 2019

Thanks for the review @bradzacher .

Please add an example to the rule's readme so people can see this functionality without looking at the tests.

Done.

@typescript-eslint/core-team do we want to put this behind a setting (default on) in case people don't want to "trust" type annotations?
I.e. might not trust them because the following case passes:

type X = Function;
const x: X = () => 1;

I think you are right. I made this opt-in.

@gilbsgilbs gilbsgilbs force-pushed the gilbsgilbs:explicit-variable-type-arrow-function branch 3 times, most recently from 871c9b1 to d08e435 Feb 12, 2019

@gilbsgilbs gilbsgilbs force-pushed the gilbsgilbs:explicit-variable-type-arrow-function branch from d08e435 to 8a73cee Feb 14, 2019

@gilbsgilbs gilbsgilbs force-pushed the gilbsgilbs:explicit-variable-type-arrow-function branch 2 times, most recently from db9f929 to 17acfba Feb 15, 2019

@gilbsgilbs gilbsgilbs force-pushed the gilbsgilbs:explicit-variable-type-arrow-function branch from 17acfba to 072afa5 Feb 16, 2019

@gilbsgilbs

This comment has been minimized.

Copy link
Author

gilbsgilbs commented Feb 18, 2019

@bradzacher @j-f1 , is there still something preventing this PR from being merged?

@bradzacher

This comment has been minimized.

Copy link
Member

bradzacher commented Feb 19, 2019

Please avoid the workflow of amend + force push.
When you use that workflow, it means your branch has only one commit in it.
This means that if we review your code + suggest changes, then you make the changes and commit them via amending we (and git, and github) can't tell the branch state before + after the review.
The result of that is that we have to review the entire PR if you force push so that we can make sure that the changes are what we expect.

@gilbsgilbs

This comment has been minimized.

Copy link
Author

gilbsgilbs commented Feb 19, 2019

@bradzacher I didn't realize GitHub couldn't handle this properly. Also, I'm not very used to commitlint and was unsure what commit messages I should use for non-features commits. I'll do my best to avoid force-pushes in the future. All my apologies for the inconvenience and thanks for your time and review.

gilbsgilbs added some commits Feb 23, 2019

gilbsgilbs added some commits Feb 23, 2019

@nimaa77

This comment has been minimized.

Copy link

nimaa77 commented Mar 14, 2019

any updates on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.