@fimbul/mimir
Advanced tools
Comparing version 0.21.0-dev.20190318 to 0.21.0-dev.20190322
{ | ||
"name": "@fimbul/mimir", | ||
"version": "0.21.0-dev.20190318", | ||
"version": "0.21.0-dev.20190322", | ||
"description": "Core rules of the Fimbullinter project", | ||
@@ -28,3 +28,3 @@ "main": "recommended.yaml", | ||
"dependencies": { | ||
"@fimbul/ymir": "0.21.0-dev.20190318", | ||
"@fimbul/ymir": "0.21.0-dev.20190322", | ||
"chalk": "^2.3.2", | ||
@@ -31,0 +31,0 @@ "debug": "^4.0.0", |
@@ -65,3 +65,3 @@ "use strict"; | ||
return [formatPrimitive(prefixFn(false))]; | ||
if (this.program === undefined || !tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'strictNullChecks')) | ||
if (this.context.compilerOptions === undefined || !tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'strictNullChecks')) | ||
return []; | ||
@@ -68,0 +68,0 @@ const checker = this.program.getTypeChecker(); |
@@ -15,3 +15,3 @@ "use strict"; | ||
super(...arguments); | ||
this.strictNullChecks = tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'strictNullChecks'); | ||
this.strictNullChecks = tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'strictNullChecks'); | ||
} | ||
@@ -38,3 +38,3 @@ apply() { | ||
if (node.exclamationToken !== undefined && | ||
node.initializer === undefined && (!tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'strictNullChecks') || | ||
node.initializer === undefined && (!tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'strictNullChecks') || | ||
getNullableFlags(this.checker.getTypeAtLocation(node.name), true) & ts.TypeFlags.Undefined)) | ||
@@ -47,3 +47,3 @@ this.addFinding(node.exclamationToken.end - 1, node.exclamationToken.end, FAIL_DEFINITE_ASSIGNMENT, ymir_1.Replacement.delete(node.exclamationToken.pos, node.exclamationToken.end)); | ||
!tsutils_1.hasModifier(node.modifiers, ts.SyntaxKind.AbstractKeyword) && (node.name.kind !== ts.SyntaxKind.Identifier || | ||
!tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'strictPropertyInitialization') || | ||
!tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'strictPropertyInitialization') || | ||
getNullableFlags(this.checker.getTypeAtLocation(node), true) & ts.TypeFlags.Undefined)) | ||
@@ -50,0 +50,0 @@ this.addFinding(node.exclamationToken.end - 1, node.exclamationToken.end, FAIL_DEFINITE_ASSIGNMENT, ymir_1.Replacement.delete(node.exclamationToken.pos, node.exclamationToken.end)); |
@@ -36,3 +36,3 @@ "use strict"; | ||
checkObjectDestructuring(node) { | ||
if (this.program === undefined || !tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'strictNullChecks')) | ||
if (this.context.compilerOptions === undefined || !tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'strictNullChecks')) | ||
return; | ||
@@ -65,3 +65,3 @@ const checker = this.program.getTypeChecker(); | ||
checkBindingPattern(node, propNames) { | ||
if (this.program === undefined || !tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'strictNullChecks')) | ||
if (this.context.compilerOptions === undefined || !tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'strictNullChecks')) | ||
return; | ||
@@ -68,0 +68,0 @@ const checker = this.program.getTypeChecker(); |
@@ -57,3 +57,3 @@ "use strict"; | ||
super(...arguments); | ||
this.strictNullChecks = tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'strictNullChecks'); | ||
this.strictNullChecks = tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'strictNullChecks'); | ||
} | ||
@@ -60,0 +60,0 @@ apply() { |
@@ -11,3 +11,3 @@ "use strict"; | ||
super(...arguments); | ||
this.strictFile = this.program !== undefined && tsutils_1.isStrictCompilerOptionEnabled(this.program.getCompilerOptions(), 'alwaysStrict') | ||
this.strictFile = this.context.compilerOptions !== undefined && tsutils_1.isStrictCompilerOptionEnabled(this.context.compilerOptions, 'alwaysStrict') | ||
? "due to the compilerOption 'alwaysStrict' this code is in strict mode" | ||
@@ -14,0 +14,0 @@ : ts.isExternalModule(this.sourceFile) |
@@ -44,3 +44,3 @@ "use strict"; | ||
isIterationProtocolAvailable() { | ||
return this.sourceFile.languageVersion >= ts.ScriptTarget.ES2015 || this.program.getCompilerOptions().downlevelIteration === true; | ||
return this.sourceFile.languageVersion >= ts.ScriptTarget.ES2015 || this.context.compilerOptions.downlevelIteration === true; | ||
} | ||
@@ -64,3 +64,3 @@ isArrayLike(type) { | ||
return path.normalize(path.dirname(node.getSourceFile().fileName)) | ||
=== path.dirname(ts.getDefaultLibFilePath(this.program.getCompilerOptions())); | ||
=== path.dirname(ts.getDefaultLibFilePath(this.context.compilerOptions)); | ||
} | ||
@@ -67,0 +67,0 @@ isIterable(type, node) { |
@@ -9,3 +9,3 @@ "use strict"; | ||
this.program.getSemanticDiagnostics(this.sourceFile).forEach(this.addDiagnostic, this); | ||
if (tsutils_1.isCompilerOptionEnabled(this.program.getCompilerOptions(), 'declaration')) | ||
if (tsutils_1.isCompilerOptionEnabled(this.context.compilerOptions, 'declaration')) | ||
this.program.getDeclarationDiagnostics(this.sourceFile).forEach(this.addDiagnostic, this); | ||
@@ -12,0 +12,0 @@ } |
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
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
401979
+ Added@fimbul/ymir@0.21.0-dev.20190322(transitive)
- Removed@fimbul/ymir@0.21.0-dev.20190318(transitive)