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): add new no-base-to-string rule #1522

Merged
merged 7 commits into from Feb 29, 2020

Conversation

JoshuaKGoldberg
Copy link
Member

Fixes #258.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

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: new plugin rule New rule request for eslint-plugin label Jan 25, 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.

mostly lgtm.
a few suggestions.
thanks for working on this

packages/eslint-plugin/docs/rules/base-to-string.md Outdated Show resolved Hide resolved
packages/eslint-plugin/docs/rules/base-to-string.md Outdated Show resolved Hide resolved
packages/eslint-plugin/src/rules/base-to-string.ts Outdated Show resolved Hide resolved
packages/eslint-plugin/src/rules/base-to-string.ts Outdated Show resolved Hide resolved
@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label Feb 20, 2020
@JoshuaKGoldberg JoshuaKGoldberg changed the title feat(eslint-plugin): add new base-to-string rule feat(eslint-plugin): add new no-base-to-string rule Feb 22, 2020
@JoshuaKGoldberg
Copy link
Member Author

Btw, I re-read the conversation in #203, and it looks like this would be one of the rules where the no- prefix would be preferable. Added 👍

@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Feb 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.

noice

thanks for this, LGTM

@codecov
Copy link

codecov bot commented Feb 29, 2020

Codecov Report

Merging #1522 into master will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1522      +/-   ##
==========================================
+ Coverage   95.53%   95.56%   +0.02%     
==========================================
  Files         142      143       +1     
  Lines        6630     6670      +40     
  Branches     1900     1910      +10     
==========================================
+ Hits         6334     6374      +40     
  Misses        106      106              
  Partials      190      190              
Impacted Files Coverage Δ
...kages/eslint-plugin/src/rules/no-base-to-string.ts 100.00% <0.00%> (ø)

@bradzacher bradzacher merged commit 8333d41 into typescript-eslint:master Feb 29, 2020
@JoshuaKGoldberg JoshuaKGoldberg deleted the base-to-string branch February 29, 2020 05:00
@felixfbecker
Copy link

I noticed a false positive on URLSearchParams toString(). Probably should have an actual addition to dom.d.ts since it's overridden?

@HolgerJeromin
Copy link

I have no idea why I get an error for this boolean:
error @typescript-eslint/no-base-to-string : 'window.navigator.cookieEnabled will evaluate to '[Object object]' when stringified.

@bradzacher
Copy link
Member

bradzacher commented Mar 3, 2020

#1655

Please use the issue search.

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

Successfully merging this pull request may close these issues.

Rule proposal: ban calls that result into base toString() methods
5 participants