Comments (4)
ESLint rule key valid-typeof
from sonarjs.
Ref to ESLint rule: https://eslint.org/docs/2.0.0/rules/valid-typeof
from sonarjs.
TypeScript compiler complains when typeof
is compared to the wrong literal, so there is no sense for us to have this rule enabled for TypeScript.
Message from typescript compiler:
This condition will always return 'false' since the types '"string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"' and '"Number"' have no overlap.ts(2367)
from sonarjs.
@ilia-kebets-sonarsource indeed, it seems this rule does not make sense for TS as such code would be invalid.
from sonarjs.
Related Issues (20)
- Fix FP S3403 (`different-types-comparison`): Ignore when comparing to `null` or `undefined` HOT 2
- Fix FP S3800 (`function-return-type`): Exceptions sanitation functions HOT 1
- Fix FP S3504 (`no-var`): Ignore rule for codebases below ES5 HOT 1
- Fix FP S4323 (`use-type-alias`): Ignore nullable types HOT 1
- Fix FP S2871 (`no-alphabetical-sort`): Add exception for string arrays HOT 4
- Fix FP S6594 (`sonar-prefer-regexp-exec`): Ignore match count use case
- Consider supporting RSPEC-110 (class hierarchy too deep) HOT 1
- Fix FN S4123 ("no-invalid-await"): when an async function returns a boolean HOT 1
- Consider using exclusion filter directly in the sensor
- Fix FP S3800 (`function-return-type`): Exceptions for React components HOT 2
- Analysis should not fail when highlighting has invalid text range HOT 1
- Fix FN S6661 (`prefer-object-spread`): cover assignments with a variable as a first argument HOT 1
- Fix FP S4328 (`no-implicit-dependencies `): add exception for `semver` HOT 1
- Improve logs when Node.js embedded is not usable in host
- FP S2187: SonarJS project's S6606 unit test file triggers the rule unexpectedly HOT 1
- Implement quickfix for S6846 (`no-access-key`): Remove the `accessKey` attribute HOT 1
- Fix FP S3699 (`no-use-of-empty-return-value`): Ignore ambient functions
- Improve synchronization between Node.js parent process and worker thread
- Change log level of line `Failed to parse file ...` HOT 1
- Make jest `maxWorkers` more robust and adaptable 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 sonarjs.