@fimbul/mimir
Advanced tools
Comparing version 0.5.0-dev.20180311 to 0.5.0-dev.20180313
{ | ||
"name": "@fimbul/mimir", | ||
"version": "0.5.0-dev.20180311", | ||
"version": "0.5.0-dev.20180313", | ||
"description": "Core rules of the Fimbullinter project", | ||
@@ -5,0 +5,0 @@ "main": "recommended.yaml", |
@@ -38,2 +38,3 @@ # Mímir | ||
`no-useless-initializer` | Detects unnecessary initialization with `undefined`. | TSLint's rule `no-unnecessary-initializer` doesn't fix all parameter initializers and gives false positives for destructuring. | ||
`no-useless-predicate` | Detects redundant conditions that are either always true or always false. *requires type information* | Combination of TSLint's `strict-type-predicates`, `typeof-compare` and parts of `strict-boolean-expressions`. | ||
`prefer-dot-notation` | Prefer `obj.foo` over `obj['foo']` where possible. | Same as TSLint's `no-string-literal` rule, but more performant. | ||
@@ -40,0 +41,0 @@ `prefer-number-isnan` | Prefer ES2015's `Number.isNaN` over the global `isNaN` mainly for performance. *requires type information* | No similar rule in TSLint. |
@@ -9,3 +9,4 @@ import * as ts from 'typescript'; | ||
private visitNode(wrap); | ||
private shouldFail(); | ||
private fail({asteriskToken, name}); | ||
} |
@@ -22,3 +22,3 @@ "use strict"; | ||
wrap.children.forEach(this.visitNode, this); | ||
if (!this.containsYield) | ||
if (this.shouldFail()) | ||
this.fail(wrap.node.parent); | ||
@@ -47,2 +47,5 @@ wrap = wrap.skip; | ||
} | ||
shouldFail() { | ||
return !this.containsYield; | ||
} | ||
fail({ asteriskToken, name }) { | ||
@@ -49,0 +52,0 @@ this.addFailure(asteriskToken.end - 1, asteriskToken.end, `Generator ${name === undefined ? '' : `'${name.getText(this.sourceFile).replace(/'/g, "\\'")}' `}contains no 'yield'.`); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
185100
84
2060
60