@fimbul/wotan
Advanced tools
Comparing version 0.4.0-dev.20180227 to 0.4.0-dev.20180228
{ | ||
"name": "@fimbul/wotan", | ||
"version": "0.4.0-dev.20180227", | ||
"version": "0.4.0-dev.20180228", | ||
"description": "Pluggable TypeScript and JavaScript linter", | ||
@@ -5,0 +5,0 @@ "bin": "bin/main.js", |
@@ -59,2 +59,3 @@ # wotan | ||
`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. | ||
`prefer-number-isnan` | Prefer ES2015's `Number.isNaN` over the global `isNaN` mainly for performance. *requires type information* | No similar rule in TSLint. | ||
`prefer-object-spread` | Prefer object spread over `Object.assign` for copying properties to a new object. | Performance, and better handling of parens in fixer. | ||
@@ -61,0 +62,0 @@ `syntaxcheck` | Reports syntax errors as lint errors. This rule is **not** enabled in `wotan:recommended`. *requires type information* | Used to be part of the deprecated `tslint --type-check` |
@@ -255,3 +255,3 @@ "use strict"; | ||
const num = parseInt(args[index + 1], 10); | ||
if (!isNaN(num)) | ||
if (!Number.isNaN(num)) | ||
return { index: index + 1, argument: num }; | ||
@@ -258,0 +258,0 @@ } |
@@ -83,3 +83,3 @@ "use strict"; | ||
} | ||
if (ctor.supports !== undefined && !ctor.supports(sourceFile, options, config.settings)) { | ||
if (ctor.supports !== undefined && !ctor.supports(sourceFile, { program, options, settings: config.settings })) { | ||
log(`Rule %s does not support this file`, ruleName); | ||
@@ -86,0 +86,0 @@ continue; |
@@ -47,5 +47,10 @@ import * as ts from 'typescript'; | ||
readonly deprecated?: boolean | string; | ||
supports?(sourceFile: ts.SourceFile, options: any, settings: Settings): boolean; | ||
supports?(sourceFile: ts.SourceFile, context: RuleSupportsContext): boolean; | ||
new (context: RuleContext): AbstractRule; | ||
} | ||
export interface RuleSupportsContext { | ||
readonly program?: ts.Program; | ||
readonly settings: Settings; | ||
readonly options: {} | null | undefined; | ||
} | ||
export interface RuleContext { | ||
@@ -71,4 +76,4 @@ readonly program?: ts.Program; | ||
static readonly requiresTypeInformation: boolean; | ||
static deprecated?: boolean | string; | ||
static supports?(sourceFile: ts.SourceFile, options: any, settings: Settings): boolean; | ||
static deprecated: boolean | string; | ||
static supports?: (sourceFile: ts.SourceFile, context: RuleSupportsContext) => boolean; | ||
static validateConfig?(config: any): string[] | string | undefined; | ||
@@ -75,0 +80,0 @@ readonly sourceFile: ts.SourceFile; |
@@ -58,2 +58,4 @@ "use strict"; | ||
AbstractRule.requiresTypeInformation = false; | ||
AbstractRule.deprecated = false; | ||
AbstractRule.supports = undefined; | ||
exports.AbstractRule = AbstractRule; | ||
@@ -60,0 +62,0 @@ class ConfigurableRule extends AbstractRule { |
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
406411
163
5171
227