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): additional annotation spacing rules for variables, parameters, properties, return types #1496

Merged
merged 9 commits into from Mar 2, 2020

Conversation

chkt
Copy link
Contributor

@chkt chkt commented Jan 22, 2020

This PR provides additional annotation spacing rules as discussed in #1489. The additional rules for variable declarations, function parameters, properties and return types are non-breaking and conform to the preexisting configuration conventions of the rule.

Fixes #1489

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @chkt!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@bradzacher bradzacher added the enhancement: plugin rule option New rule option for an existing eslint-plugin rule label Jan 23, 2020
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic itself looks sound, just some suggested changes around your guards.
Thanks for working on this.

@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label Feb 28, 2020
@codecov
Copy link

codecov bot commented Feb 29, 2020

Codecov Report

Merging #1496 into master will decrease coverage by 0.26%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1496      +/-   ##
==========================================
- Coverage   95.57%   95.30%   -0.27%     
==========================================
  Files         143      143              
  Lines        6689     6736      +47     
  Branches     1916     1938      +22     
==========================================
+ Hits         6393     6420      +27     
- Misses        106      110       +4     
- Partials      190      206      +16     

@chkt chkt requested a review from bradzacher February 29, 2020 19:05
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Feb 29, 2020
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks for your work on this

@bradzacher bradzacher merged commit b097245 into typescript-eslint:master Mar 2, 2020
@alumni
Copy link

alumni commented Mar 6, 2020

This would disallow:

export type Constructor<T = {}> = new (...args: any[]) => T;

and force:

export type Constructor<T = {}> = new (...args: any[])=> T;

The space before the arrow is removed.
I know styling is subjective, but the first one looks better :)

@alumni
Copy link

alumni commented Mar 6, 2020

@bradzacher
Copy link
Member

Please use the issue search.
This has been fixed in master #1663

@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Mar 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: plugin rule option New rule option for an existing eslint-plugin rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[type-annotation-spacing] no distinction between parameters, properties and return types
3 participants