@fimbul/wotan
Advanced tools
Comparing version 0.24.0-dev.20210122 to 0.24.0-dev.20210131
{ | ||
"name": "@fimbul/wotan", | ||
"version": "0.24.0-dev.20210122", | ||
"version": "0.24.0-dev.20210131", | ||
"description": "Pluggable TypeScript and JavaScript linter", | ||
@@ -43,3 +43,3 @@ "bin": "bin/main.js", | ||
"dependencies": { | ||
"@fimbul/mimir": "0.24.0-dev.20210122", | ||
"@fimbul/mimir": "0.24.0-dev.20210131", | ||
"@fimbul/ymir": "0.22.0", | ||
@@ -46,0 +46,0 @@ "bind-decorator": "^1.0.11", |
@@ -17,5 +17,5 @@ import { GlobalOptions, Severity } from '@fimbul/ymir'; | ||
fix: OptionParser.ParseFunction<number | boolean>; | ||
extensions: OptionParser.ParseFunction<readonly string[] | undefined>; | ||
extensions: OptionParser.ParseFunction<string[] | undefined>; | ||
reportUselessDirectives: OptionParser.ParseFunction<boolean | Severity>; | ||
}; | ||
export declare function parseGlobalOptions(options: GlobalOptions | undefined): ParsedGlobalOptions; |
@@ -240,3 +240,3 @@ "use strict"; | ||
config, | ||
modules: modules === undefined ? defaults.modules : modules, | ||
modules: modules !== null && modules !== void 0 ? modules : defaults.modules, | ||
command: "show" /* Show */, | ||
@@ -243,0 +243,0 @@ file: files[0], |
@@ -20,3 +20,4 @@ "use strict"; | ||
run(options) { | ||
const formatter = new (this.formatterLoader.loadFormatter(options.formatter === undefined ? 'stylish' : options.formatter))(); | ||
var _a; | ||
const formatter = new (this.formatterLoader.loadFormatter((_a = options.formatter) !== null && _a !== void 0 ? _a : 'stylish'))(); | ||
const result = this.runner.lintCollection(options); | ||
@@ -23,0 +24,0 @@ let success = true; |
@@ -73,3 +73,3 @@ "use strict"; | ||
const { transformed, changeRange } = processor.updateSource(fixed.result, fixed.range); | ||
fixedRange = changeRange !== undefined ? changeRange : utils_1.calculateChangeRange(file.text, transformed); | ||
fixedRange = changeRange !== null && changeRange !== void 0 ? changeRange : utils_1.calculateChangeRange(file.text, transformed); | ||
newSource = transformed; | ||
@@ -84,4 +84,3 @@ } | ||
log('Rolling back latest fixes and abort linting'); | ||
if (processor !== undefined) // reset processor state | ||
processor.updateSource(content, utils_1.invertChangeRange(fixed.range)); | ||
processor === null || processor === void 0 ? void 0 : processor.updateSource(content, utils_1.invertChangeRange(fixed.range)); // reset processor state | ||
break; | ||
@@ -88,0 +87,0 @@ } |
@@ -17,3 +17,3 @@ export declare namespace OptionParser { | ||
function map<T extends ReadonlyArray<U> | undefined, U, V>(parseFn: ParseFunction<T>, cb: (item: U) => V): ParseFunction<{ | ||
[K in keyof T]: V; | ||
-readonly [K in keyof T]: V; | ||
}>; | ||
@@ -20,0 +20,0 @@ function transform<T, U>(parseFn: ParseFunction<T>, cb: (value: T) => U): ParseFunction<U>; |
@@ -46,12 +46,7 @@ "use strict"; | ||
function map(parseFn, cb) { | ||
return (value, report) => { | ||
const result = parseFn(value, report); | ||
return (result === undefined ? undefined : result.map(cb)); | ||
}; | ||
return (value, report) => { var _a; return (_a = parseFn(value, report)) === null || _a === void 0 ? void 0 : _a.map(cb); }; | ||
} | ||
Transform.map = map; | ||
function transform(parseFn, cb) { | ||
return (value, report) => { | ||
return cb(parseFn(value, report)); | ||
}; | ||
return (value, report) => cb(parseFn(value, report)); | ||
} | ||
@@ -58,0 +53,0 @@ Transform.transform = transform; |
@@ -26,2 +26,3 @@ "use strict"; | ||
parseLineSwitches(context) { | ||
var _a, _b; | ||
const { sourceFile, ruleNames } = context; | ||
@@ -87,3 +88,3 @@ let wrappedAst; | ||
continue; // rule is already enabled | ||
result.set(rule, [{ pos: rawLineSwitch.pos, end: rawLineSwitch.end === undefined ? Infinity : rawLineSwitch.end, switch: ruleSwitch }]); | ||
result.set(rule, [{ pos: rawLineSwitch.pos, end: (_a = rawLineSwitch.end) !== null && _a !== void 0 ? _a : Infinity, switch: ruleSwitch }]); | ||
} | ||
@@ -107,3 +108,3 @@ else { | ||
pos: rawLineSwitch.pos, | ||
end: rawLineSwitch.end === undefined ? Infinity : rawLineSwitch.end, | ||
end: (_b = rawLineSwitch.end) !== null && _b !== void 0 ? _b : Infinity, | ||
switch: ruleSwitch, | ||
@@ -110,0 +111,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
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
336549
4202
+ Added@fimbul/mimir@0.24.0-dev.20210131(transitive)
- Removed@fimbul/mimir@0.24.0-dev.20210122(transitive)