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): [space-infix-ops] Add support for Union and intersection of type declarations #3360

Merged

Conversation

doumart
Copy link
Contributor

@doumart doumart commented May 8, 2021

Second PR so maybe i'm missing something. I added support for Union and Intersection of interface and type declarations.
There is the yarn.lock that was updated and don't understand why, i can remove it if it not support to be there

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @doumart!

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.

@doumart doumart force-pushed the feat/space-infix-ops-uniontype branch 5 times, most recently from ff7c667 to c7841fc Compare May 8, 2021 01:36
@bradzacher bradzacher added the enhancement: plugin rule option New rule option for an existing eslint-plugin rule label May 9, 2021
@bradzacher
Copy link
Member

I would just try reverting the changes to the lock file.
It looks like for some reason it has installed new versions.
So yeah - revert lock file, and re-install.

@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label May 9, 2021
@doumart
Copy link
Contributor Author

doumart commented May 11, 2021

Will hopefully resolve #51

@doumart doumart changed the title feat(space-infix-ops): Add support for Union and intersection of type declarations feat(eslint-plugin): [space-infix-ops] Add support for Union and intersection of type declarations May 11, 2021
@doumart doumart force-pushed the feat/space-infix-ops-uniontype branch 2 times, most recently from 6e61468 to 2bfe856 Compare May 11, 2021 22:43
@codecov
Copy link

codecov bot commented May 11, 2021

Codecov Report

Merging #3360 (a5524c2) into master (61e0353) will decrease coverage by 0.01%.
The diff coverage is 86.66%.

❗ Current head a5524c2 differs from pull request most recent head 63f5658. Consider uploading reports for the commit 63f5658 to get more accurate results

@@            Coverage Diff             @@
##           master    #3360      +/-   ##
==========================================
- Coverage   92.67%   92.65%   -0.02%     
==========================================
  Files         318      318              
  Lines       11109    11116       +7     
  Branches     3155     3157       +2     
==========================================
+ Hits        10295    10300       +5     
- Misses        362      363       +1     
- Partials      452      453       +1     
Flag Coverage Δ
unittest 92.65% <86.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ackages/eslint-plugin/src/rules/space-infix-ops.ts 90.90% <86.66%> (-6.53%) ⬇️
packages/typescript-estree/src/convert.ts 98.24% <0.00%> (-0.03%) ⬇️
packages/eslint-plugin/src/rules/dot-notation.ts 92.59% <0.00%> (ø)
packages/eslint-plugin/src/util/types.ts 82.25% <0.00%> (+1.07%) ⬆️

@doumart doumart force-pushed the feat/space-infix-ops-uniontype branch 2 times, most recently from 2e35a88 to 338b23f Compare May 11, 2021 23:08
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label May 11, 2021
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.

looking good so far! The logic looks sound. A few small comments.

Please add some negative tests for things like

const x: string&number;
class Test {
  value: string&number;
}
function foo<T extends string&number>() {}
function bar(): string&number {}

packages/eslint-plugin/src/rules/space-infix-ops.ts Outdated Show resolved Hide resolved
packages/eslint-plugin/src/rules/space-infix-ops.ts Outdated Show resolved Hide resolved
packages/eslint-plugin/src/rules/space-infix-ops.ts Outdated Show resolved Hide resolved
packages/eslint-plugin/src/rules/space-infix-ops.ts Outdated Show resolved Hide resolved
@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label May 15, 2021
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label May 24, 2021
@doumart doumart force-pushed the feat/space-infix-ops-uniontype branch from bc79357 to 63f5658 Compare May 27, 2021 00:15
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.

thanks for your contribution!

@bradzacher bradzacher merged commit 3d29323 into typescript-eslint:master May 28, 2021
@simPod
Copy link

simPod commented Jun 5, 2021

How can I disable this rule from adding a space to my union types? There seems to be no config for it. Thanks

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2021
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.

None yet

3 participants