Giter Site home page Giter Site logo

Comments (4)

bradzacher avatar bradzacher commented on June 3, 2024 1

and !(/* codes */) should also be checked

The rule will ignore the not operator if its in the context of a conditional test. Otherwise it will intentionally ignore it.
I firmly disagree that this should apply to a general "not" expression across the codebase.


As for the Boolean constructor - I can see an argument for it. People have asked for it in other rules.

Currently none of our rules consider it as a boolean/conditional context - usually intentionally so because it doesn't align with the rule's intent. In this instance I can see the draw behind it as a general-purpose opt-out from the rule's checks. Probably good value as another option.

from typescript-eslint.

Mister-Hope avatar Mister-Hope commented on June 3, 2024

Yes, for the not operator, we can omit it as we can definitely use a not operator on a boolean constructor to bypass it.

Thanks for supporting this request, As is really annoying that multiple bugs are introduced in my repo by simply turning on this rule and use the auto fix future

from typescript-eslint.

Mister-Hope avatar Mister-Hope commented on June 3, 2024

@bradzacher Still need a further confirm, I notice you renamed this as enhancement, but I refuse for this, as the auto-fix has introduce false positive into codes.

I would rather treat this as a fix, and I believe the new option should be default on. We should be extremely careful that an auto fix can introduce false positive

from typescript-eslint.

bradzacher avatar bradzacher commented on June 3, 2024

The rule intentionally did not treat Boolean as a conditional context. It is not a bug that it did not.

Adding support to treat it as a special case is a new feature and likely will be behind its own option.

Based on anecdotal experience your codebase's treatment is a rarer case.

Regardless - the tagging doesn't matter - that really just determines if it is a patch or a minor release when it merges. It doesn't change the priority - either way this will be waiting for a community member to action it.

from typescript-eslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.