Comments (4)
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.
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.
@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.
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)
- Bug: [prefer-nullish-coalescing] should consider the difference between null and undefined with strict equality HOT 2
- Bug: 8.0.0.alpha24 shared configuration with type checking fail to start HOT 1
- Bug: `no-floating-promises` should not fire on `Promise.resolve()` HOT 2
- Rule proposal: Prevent unnecessary `| undefined` for optional parameters HOT 3
- Bug(typescript-estree): Project services not working with (tsconfig) extends, project references, and extraFileExtensions HOT 3
- Bug: [no-unnecessary-type-assertion] Conflict with TS for variables used before assignment HOT 5
- Docs: Move PR-specific testing advice from Contributing > Local Development to Pull Requests
- Rule proposal: Consider bringing back no-duplicate-imports HOT 1
- Website: Rules sidebar missing from "tombstone" pages HOT 5
- Bug: [no-redundant-type-constituents] Differentiate a types-error any from a "true" any
- Bug: [no-unsafe-argument] Differentiate a types-error any from a "true" any
- Bug: [no-unsafe-call] Differentiate a types-error any from a "true" any
- Bug: [no-unsafe-member-access] Differentiate a types-error any from a "true" any
- Bug: [no-unsafe-return] Differentiate a types-error any from a "true"
- AST tightening: `TSDeclareFunction` has no body, `declare function` cannot have `async` or `*` HOT 1
- AST tightening: `TSExternalModuleReference#expression` must be a `StringLiteral` HOT 1
- AST tightening: around init/definite combinations on let/var/const declarators HOT 1
- AST tightening: `PrivateIdentifier` can only be LHS of `BinaryExpression[operator='in']` HOT 1
- Bug: rc-v8 projectService option leads to default project errors when used with eslint-plugin-import
- [v8] Bug: Missing peer dependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-eslint.