@fimbul/mimir
Advanced tools
Comparing version 0.6.0-dev.20180321 to 0.6.0-dev.20180322
{ | ||
"name": "@fimbul/mimir", | ||
"version": "0.6.0-dev.20180321", | ||
"version": "0.6.0-dev.20180322", | ||
"description": "Core rules of the Fimbullinter project", | ||
@@ -28,3 +28,3 @@ "main": "recommended.yaml", | ||
"dependencies": { | ||
"@fimbul/ymir": "0.6.0-dev.20180321", | ||
"@fimbul/ymir": "0.6.0-dev.20180322", | ||
"chalk": "^2.3.2", | ||
@@ -31,0 +31,0 @@ "debug": "^3.1.0", |
@@ -31,3 +31,3 @@ # Mímir | ||
`no-inferred-empty-object` | Warns if a type parameter is inferred as `{}` because the compiler cannot find any inference site. | Really checks every type parameter of function, method and constructor calls. Correctly handles type parameters from JSDoc comments. Recognises type parameter defaults on all merged declarations. | ||
`no-misused-generics` | Detects generic type parameters that cannot be inferred from the functions parameters. | There's no similar TSLint rule. | ||
`no-misused-generics` | Detects generic type parameters that cannot be inferred from the functions parameters. It also detects generics that don't enforce any constraint between types. | There's no similar TSLint rule. | ||
`no-nan-compare` | Don't compare with `NaN`, use `isNaN(number)` or `Number.isNaN(number)` instead. | Performance! | ||
@@ -34,0 +34,0 @@ `no-return-await` | Warns for unnecesary `return await foo;` when you can simply `return foo;` | The same as TSLint's rule. I wrote both, but this one is faster. |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
@@ -6,0 +4,0 @@ private iterate(wrap, end); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const tsutils_1 = require("tsutils"); | ||
const utils_1 = require("../utils"); | ||
class Rule extends ymir_1.TypedRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
apply() { | ||
@@ -33,4 +31,7 @@ return this.iterate(this.context.getWrappedAst().next, undefined); | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=await-async-result.js.map |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
@@ -6,0 +4,0 @@ private isPromiseLike(node); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.TypedRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
apply() { | ||
@@ -53,4 +51,7 @@ const re = /\bawait\b/g; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=await-only-promise.js.map |
@@ -1,6 +0,4 @@ | ||
import * as ts from 'typescript'; | ||
import { AbstractRule } from '@fimbul/ymir'; | ||
export declare class Rule extends AbstractRule { | ||
private containsYield; | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
@@ -7,0 +5,0 @@ private iterate(wrap, end); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
class Rule extends ymir_1.AbstractRule { | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
constructor() { | ||
@@ -11,5 +12,2 @@ super(...arguments); | ||
} | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
apply() { | ||
@@ -53,3 +51,6 @@ return this.iterate(this.context.getWrappedAst().next, undefined); | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -56,0 +57,0 @@ function isGenerator(node) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -22,4 +20,7 @@ let wrappedAst; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=new-parens.js.map |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -7,6 +8,3 @@ const ts = require("typescript"); | ||
const utils_1 = require("../utils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -19,3 +17,6 @@ for (const { caseBlock: { clauses } } of utils_1.switchStatements(this.context)) | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -22,0 +23,0 @@ function isForbiddenDeclaration(node) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -25,3 +23,6 @@ const re = /\bdebugger\s*(?:[/;]|$)/mg; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -28,0 +29,0 @@ function canSafelyRemoveStatement(statement) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -7,6 +8,3 @@ const ts = require("typescript"); | ||
const utils_1 = require("../utils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -25,3 +23,6 @@ for (const { caseBlock: { clauses } } of utils_1.switchStatements(this.context)) { | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -28,0 +29,0 @@ function isFallthroughComment(pos, end, _kind, _newline, text) { |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
private scanner; | ||
@@ -6,0 +4,0 @@ apply(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -7,3 +8,3 @@ const ts = require("typescript"); | ||
const typescriptPre270 = /^2\.[456]\./.test(ts.version); | ||
class Rule extends ymir_1.TypedRule { | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
constructor() { | ||
@@ -13,6 +14,2 @@ super(...arguments); | ||
} | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile && | ||
/\.tsx?$/.test(sourceFile.fileName); | ||
} | ||
apply() { | ||
@@ -112,3 +109,7 @@ for (const node of this.context.getFlatAst()) { | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles, | ||
ymir_1.typescriptOnly | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -115,0 +116,0 @@ function getTemplateTags(node) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
private usage; | ||
apply(): void; | ||
private isUsedInParameterTypes(typeParameter, range); | ||
private checkTypeParameters(typeParameters, signature); | ||
private isConstrainedByOtherTypeParameter(current, all); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return /\.tsx?$/.test(sourceFile.fileName); | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
for (const node of this.context.getFlatAst()) | ||
if (tsutils_1.isSignatureDeclaration(node) && node.typeParameters !== undefined) | ||
for (const typeParameter of node.typeParameters) | ||
if (!this.isUsedInParameterTypes(typeParameter, node.parameters)) | ||
this.addFailureAtNode(typeParameter, `TypeParameter '${typeParameter.name.text}' cannot be inferred from any parameter.`); | ||
this.checkTypeParameters(node.typeParameters, node); | ||
} | ||
isUsedInParameterTypes(typeParameter, range) { | ||
checkTypeParameters(typeParameters, signature) { | ||
if (this.usage === undefined) | ||
this.usage = tsutils_1.collectVariableUsage(this.sourceFile); | ||
for (const use of this.usage.get(typeParameter.name).uses) | ||
if (use.location.pos > range.pos && use.location.pos < range.end) | ||
return true; | ||
outer: for (const typeParameter of typeParameters) { | ||
let usedInParameters = false; | ||
let usedInReturnOrExtends = tsutils_1.isFunctionWithBody(signature); | ||
for (const use of this.usage.get(typeParameter.name).uses) { | ||
if (use.location.pos > signature.parameters.pos && use.location.pos < signature.parameters.end) { | ||
if (usedInParameters) | ||
continue outer; | ||
usedInParameters = true; | ||
} | ||
else if (!usedInReturnOrExtends) { | ||
usedInReturnOrExtends = use.location.pos > signature.parameters.end || isUsedInConstraint(use.location, typeParameters); | ||
} | ||
} | ||
if (!usedInParameters) { | ||
this.addFailureAtNode(typeParameter, `TypeParameter '${typeParameter.name.text}' cannot be inferred from any parameter.`); | ||
} | ||
else if (!usedInReturnOrExtends && !this.isConstrainedByOtherTypeParameter(typeParameter, typeParameters)) { | ||
this.addFailureAtNode(typeParameter, `TypeParameter '${typeParameter.name.text}' is not used to enforce a constraint between types and can be replaced with \ | ||
'${typeParameter.constraint ? typeParameter.constraint.getText(this.sourceFile) : 'any'}'.`); | ||
} | ||
} | ||
} | ||
isConstrainedByOtherTypeParameter(current, all) { | ||
if (current.constraint === undefined) | ||
return false; | ||
for (const typeParameter of all) { | ||
if (typeParameter === current) | ||
continue; | ||
for (const use of this.usage.get(typeParameter.name).uses) | ||
if (use.location.pos >= current.constraint.pos && use.location.pos < current.constraint.end) | ||
return true; | ||
} | ||
return false; | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.typescriptOnly | ||
], Rule); | ||
exports.Rule = Rule; | ||
function isUsedInConstraint(use, typeParameters) { | ||
for (const typeParameter of typeParameters) | ||
if (typeParameter.constraint !== undefined && use.pos >= typeParameter.constraint.pos && use.pos < typeParameter.constraint.end) | ||
return true; | ||
return false; | ||
} | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=no-misused-generics.js.map |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -22,3 +20,6 @@ const re = /\bNaN\b/g; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -25,0 +26,0 @@ function isEqualityCheck(kind) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -7,6 +8,3 @@ const ts = require("typescript"); | ||
const FAIL_MESSAGE = 'Awaiting the returned value is redundant as it is wrapped in a Promise anyway.'; | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -23,3 +21,6 @@ const re = /(?:^|\|\||&&|return|=>|\*\/|[,(?:])\s*await\b/mg; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -26,0 +27,0 @@ function isUnnecessaryAwait(node) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
@@ -6,0 +4,0 @@ private checkBlock(node); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -65,3 +63,6 @@ for (const node of this.context.getFlatAst()) { | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -68,0 +69,0 @@ function nextStatementIsUnreachable(statement) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -19,4 +17,7 @@ const re = /\bfinally\s*[/{]/g; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=no-unsafe-finally.js.map |
import { ConfigurableRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export interface Options { | ||
@@ -10,3 +9,2 @@ allowNew: boolean; | ||
export declare class Rule extends ConfigurableRule<Options> { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
parseOptions(input: Partial<Options> | {} | null | undefined): Options; | ||
@@ -13,0 +11,0 @@ apply(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -7,6 +8,3 @@ const ts = require("typescript"); | ||
const FAIL_MESSAGE = 'This expression is unused. Did you mean to assign a value or call a function?'; | ||
class Rule extends ymir_1.ConfigurableRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.ConfigurableRule { | ||
parseOptions(input) { | ||
@@ -84,3 +82,6 @@ return Object.assign({ allowNew: false, allowShortCircuit: false, allowTaggedTemplate: false, allowTernary: false }, input); | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -87,0 +88,0 @@ function isDirective(statement) { |
@@ -1,6 +0,4 @@ | ||
import * as ts from 'typescript'; | ||
import { AbstractRule } from '@fimbul/ymir'; | ||
export declare class Rule extends AbstractRule { | ||
private labels; | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
@@ -7,0 +5,0 @@ private iterate(wrap, end); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
class Rule extends ymir_1.AbstractRule { | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
constructor() { | ||
@@ -11,5 +12,2 @@ super(...arguments); | ||
} | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
apply() { | ||
@@ -61,4 +59,7 @@ return this.iterate(this.context.getWrappedAst().next, undefined); | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=no-unused-label.js.map |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
private strictNullChecks; | ||
@@ -6,0 +4,0 @@ apply(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -16,3 +17,3 @@ const ts = require("typescript"); | ||
| ts.TypeFormatFlags.UseStructuralFallback; | ||
class Rule extends ymir_1.TypedRule { | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
constructor() { | ||
@@ -22,5 +23,2 @@ super(...arguments); | ||
} | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile && /\.tsx?$/.test(sourceFile.fileName); | ||
} | ||
apply() { | ||
@@ -109,3 +107,7 @@ for (const node of this.context.getFlatAst()) { | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles, | ||
ymir_1.typescriptOnly | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -112,0 +114,0 @@ function typesAreEqual(a, b, checker) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
@@ -6,0 +4,0 @@ private checkFunctionParameters(parameters); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -63,3 +61,6 @@ const isJs = this.sourceFile.flags & ts.NodeFlags.JavaScriptFile; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -66,0 +67,0 @@ function isUndefined(node) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -23,3 +21,6 @@ const { text } = this.sourceFile; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -26,0 +27,0 @@ function isLabelNecessary(label) { |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
private strictNullChecks; | ||
@@ -6,0 +4,0 @@ apply(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -49,3 +50,3 @@ const ts = require("typescript"); | ||
}; | ||
class Rule extends ymir_1.TypedRule { | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
constructor() { | ||
@@ -55,5 +56,2 @@ super(...arguments); | ||
} | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
apply() { | ||
@@ -219,3 +217,6 @@ for (const node of this.context.getFlatAst()) { | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -222,0 +223,0 @@ function truthyFalsy(type) { |
import { ConfigurableRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export interface Options { | ||
@@ -7,3 +6,2 @@ destructuring: 'all' | 'any'; | ||
export declare class Rule extends ConfigurableRule<Options> { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
protected parseOptions(options: { | ||
@@ -10,0 +8,0 @@ destructuring?: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.ConfigurableRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.ConfigurableRule { | ||
parseOptions(options) { | ||
@@ -83,3 +81,6 @@ let destructuring = 'all'; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -86,0 +87,0 @@ function getScopeBoundary(node) { |
import { AbstractRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends AbstractRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.AbstractRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.AbstractRule { | ||
apply() { | ||
@@ -19,4 +17,7 @@ for (const node of this.context.getFlatAst()) { | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=prefer-dot-notation.js.map |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
private readonly usage; | ||
@@ -6,0 +4,0 @@ apply(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -7,6 +8,3 @@ const ts = require("typescript"); | ||
const path = require("path"); | ||
class Rule extends ymir_1.TypedRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
get usage() { | ||
@@ -67,3 +65,6 @@ const usage = tsutils_1.collectVariableUsage(this.sourceFile); | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -70,0 +71,0 @@ function isIterable(type) { |
import { TypedRule, RuleSupportsContext } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile, context: RuleSupportsContext): boolean; | ||
static supports(_sourceFile: ts.SourceFile, context: RuleSupportsContext): boolean; | ||
apply(): void; | ||
private isNumberLikeType(type); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -9,6 +10,4 @@ const ts = require("typescript"); | ||
const log = debug('wotan:rule:prefer-number-isnan'); | ||
class Rule extends ymir_1.TypedRule { | ||
static supports(sourceFile, context) { | ||
if (sourceFile.isDeclarationFile) | ||
return false; | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
static supports(_sourceFile, context) { | ||
const libFileDir = path.dirname(ts.getDefaultLibFilePath(context.program.getCompilerOptions())); | ||
@@ -45,4 +44,7 @@ if (context.program.getSourceFile(path.join(libFileDir, 'lib.es2015.core.d.ts')) === undefined) { | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
//# sourceMappingURL=prefer-number-isnan.js.map |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
apply(): void; | ||
private isSpreadableObject(node); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
const ts = require("typescript"); | ||
const tsutils_1 = require("tsutils"); | ||
class Rule extends ymir_1.TypedRule { | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
apply() { | ||
@@ -55,3 +53,6 @@ const re = /(?:[.\n]|\*\/)\s*assign\b/g; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -58,0 +59,0 @@ function createFix(node, sourceFile) { |
import { TypedRule } from '@fimbul/ymir'; | ||
import * as ts from 'typescript'; | ||
export declare class Rule extends TypedRule { | ||
static supports(sourceFile: ts.SourceFile): boolean; | ||
private reported; | ||
@@ -6,0 +4,0 @@ apply(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const ymir_1 = require("@fimbul/ymir"); | ||
@@ -7,3 +8,3 @@ const tsutils_1 = require("tsutils"); | ||
const utils_1 = require("../utils"); | ||
class Rule extends ymir_1.TypedRule { | ||
let Rule = class Rule extends ymir_1.TypedRule { | ||
constructor() { | ||
@@ -13,5 +14,2 @@ super(...arguments); | ||
} | ||
static supports(sourceFile) { | ||
return !sourceFile.isDeclarationFile; | ||
} | ||
apply() { | ||
@@ -76,3 +74,6 @@ const re = /\btry\s*[/{]/g; | ||
} | ||
} | ||
}; | ||
Rule = tslib_1.__decorate([ | ||
ymir_1.excludeDeclarationFiles | ||
], Rule); | ||
exports.Rule = Rule; | ||
@@ -79,0 +80,0 @@ function isInAsyncFunction(node) { |
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
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
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
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
226694
2547
+ Added@fimbul/ymir@0.6.0-dev.20180322(transitive)
- Removed@fimbul/ymir@0.6.0-dev.20180321(transitive)