@fimbul/wotan
Advanced tools
Comparing version 0.22.0-dev.20191111 to 0.22.0-dev.20200101
{ | ||
"name": "@fimbul/wotan", | ||
"version": "0.22.0-dev.20191111", | ||
"version": "0.22.0-dev.20200101", | ||
"description": "Pluggable TypeScript and JavaScript linter", | ||
@@ -37,3 +37,3 @@ "bin": "bin/main.js", | ||
"@types/minimatch": "^3.0.1", | ||
"@types/resolve": "^0.0.8", | ||
"@types/resolve": "^1.14.0", | ||
"@types/semver": "^6.0.0", | ||
@@ -44,3 +44,3 @@ "escape-string-regexp": "^2.0.0", | ||
"dependencies": { | ||
"@fimbul/mimir": "0.22.0-dev.20191111", | ||
"@fimbul/mimir": "0.22.0-dev.20200101", | ||
"@fimbul/ymir": "0.21.0", | ||
@@ -60,4 +60,4 @@ "bind-decorator": "^1.0.11", | ||
"reflect-metadata": "^0.1.12", | ||
"resolve": "^1.5.0", | ||
"semver": "^6.0.0", | ||
"resolve": "^1.14.1", | ||
"semver": "^7.0.0", | ||
"stable": "^0.1.8", | ||
@@ -64,0 +64,0 @@ "tslib": "^1.8.1", |
@@ -9,13 +9,13 @@ import { GlobalOptions } from '@fimbul/ymir'; | ||
export declare const GLOBAL_OPTIONS_SPEC: { | ||
modules: OptionParser.ParseFunction<ReadonlyArray<string>>; | ||
modules: OptionParser.ParseFunction<readonly string[]>; | ||
config: OptionParser.ParseFunction<string | undefined>; | ||
files: OptionParser.ParseFunction<ReadonlyArray<string>>; | ||
exclude: OptionParser.ParseFunction<ReadonlyArray<string>>; | ||
project: OptionParser.ParseFunction<ReadonlyArray<string>>; | ||
files: OptionParser.ParseFunction<readonly string[]>; | ||
exclude: OptionParser.ParseFunction<readonly string[]>; | ||
project: OptionParser.ParseFunction<readonly string[]>; | ||
references: OptionParser.ParseFunction<boolean>; | ||
formatter: OptionParser.ParseFunction<string | undefined>; | ||
fix: OptionParser.ParseFunction<number | boolean>; | ||
extensions: OptionParser.ParseFunction<ReadonlyArray<string> | undefined>; | ||
extensions: OptionParser.ParseFunction<readonly string[] | undefined>; | ||
reportUselessDirectives: OptionParser.ParseFunction<boolean | "warning" | "error" | "suggestion">; | ||
}; | ||
export declare function parseGlobalOptions(options: GlobalOptions | undefined): ParsedGlobalOptions; |
@@ -77,3 +77,6 @@ "use strict"; | ||
function parseLintCommand(args, defaults, command) { | ||
const result = Object.assign({ command }, defaults); | ||
const result = { | ||
command, | ||
...defaults, | ||
}; | ||
const exclude = []; | ||
@@ -80,0 +83,0 @@ const extensions = []; |
@@ -18,5 +18,10 @@ "use strict"; | ||
} | ||
run(_a) { | ||
var { command: _command } = _a, config = tslib_1.__rest(_a, ["command"]); | ||
const newContent = utils_1.format(Object.assign(Object.assign(Object.assign({}, this.options), config), { fix: config.fix || undefined, reportUselessDirectives: config.reportUselessDirectives || undefined, references: config.references || undefined }), "yaml" /* Yaml */); | ||
run({ command: _command, ...config }) { | ||
const newContent = utils_1.format({ | ||
...this.options, | ||
...config, | ||
fix: config.fix || undefined, | ||
reportUselessDirectives: config.reportUselessDirectives || undefined, | ||
references: config.references || undefined, | ||
}, "yaml" /* Yaml */); | ||
const filePath = path.join(this.directories.getCurrentDirectory(), '.fimbullinter.yaml'); | ||
@@ -28,3 +33,3 @@ if (newContent.trim() === '{}') { | ||
} | ||
catch (_b) { } | ||
catch { } | ||
} | ||
@@ -31,0 +36,0 @@ else { |
@@ -19,3 +19,7 @@ "use strict"; | ||
const optparse_1 = require("../optparse"); | ||
const TEST_OPTION_SPEC = Object.assign(Object.assign({}, argparse_1.GLOBAL_OPTIONS_SPEC), { fix: optparse_1.OptionParser.Transform.noDefault(argparse_1.GLOBAL_OPTIONS_SPEC.fix), typescriptVersion: optparse_1.OptionParser.Factory.parsePrimitive('string') }); | ||
const TEST_OPTION_SPEC = { | ||
...argparse_1.GLOBAL_OPTIONS_SPEC, | ||
fix: optparse_1.OptionParser.Transform.noDefault(argparse_1.GLOBAL_OPTIONS_SPEC.fix), | ||
typescriptVersion: optparse_1.OptionParser.Factory.parsePrimitive('string'), | ||
}; | ||
let FakeDirectoryService = class FakeDirectoryService { | ||
@@ -82,3 +86,3 @@ constructor(realDirectorySerivce) { | ||
} | ||
catch (_a) { | ||
catch { | ||
if (!options.updateBaselines) | ||
@@ -110,3 +114,3 @@ return end(false, 'MISSING'); | ||
for (const testcase of glob.sync(pattern, globOptions)) { | ||
const _a = optparse_1.OptionParser.parse(require(testcase), TEST_OPTION_SPEC, { validate: true, context: testcase, exhaustive: true }), { typescriptVersion } = _a, testConfig = tslib_1.__rest(_a, ["typescriptVersion"]); | ||
const { typescriptVersion, ...testConfig } = optparse_1.OptionParser.parse(require(testcase), TEST_OPTION_SPEC, { validate: true, context: testcase, exhaustive: true }); | ||
if (typescriptVersion !== undefined && !semver_1.satisfies(currentTypescriptVersion, typescriptVersion)) { | ||
@@ -124,3 +128,3 @@ this.logger.log(`${path.relative(basedir, testcase)} ${chalk.yellow(`SKIPPED, requires TypeScript ${typescriptVersion}`)}`); | ||
if (options.exact) { | ||
const remainingGlobOptions = Object.assign(Object.assign({}, globOptions), { cwd: baselineDir, ignore: baselinesSeen }); | ||
const remainingGlobOptions = { ...globOptions, cwd: baselineDir, ignore: baselinesSeen }; | ||
for (const unchecked of glob.sync('**', remainingGlobOptions)) { | ||
@@ -144,3 +148,3 @@ if (options.updateBaselines) { | ||
test(config, host) { | ||
const lintOptions = Object.assign(Object.assign({}, config), { fix: false }); | ||
const lintOptions = { ...config, fix: false }; | ||
const lintResult = Array.from(this.runner.lintCollection(lintOptions)); | ||
@@ -147,0 +151,0 @@ let containsFixes = false; |
@@ -17,3 +17,3 @@ "use strict"; | ||
for (const replacement of state.replacements) | ||
replacements.push(Object.assign({ fix: state }, replacement)); | ||
replacements.push({ fix: state, ...replacement }); | ||
} | ||
@@ -20,0 +20,0 @@ const range = { |
@@ -186,4 +186,10 @@ "use strict"; | ||
message, | ||
start: Object.assign({ position: pos }, ts.getLineAndCharacterOfPosition(sourceFile, pos)), | ||
end: Object.assign({ position: end }, ts.getLineAndCharacterOfPosition(sourceFile, end)), | ||
start: { | ||
position: pos, | ||
...ts.getLineAndCharacterOfPosition(sourceFile, pos), | ||
}, | ||
end: { | ||
position: end, | ||
...ts.getLineAndCharacterOfPosition(sourceFile, end), | ||
}, | ||
fix: fix === undefined | ||
@@ -190,0 +196,0 @@ ? undefined |
@@ -66,3 +66,3 @@ "use strict"; | ||
} | ||
catch (_a) { | ||
catch { | ||
return result; | ||
@@ -171,3 +171,3 @@ } | ||
} | ||
catch (_a) { } | ||
catch { } | ||
} | ||
@@ -192,3 +192,3 @@ return f; | ||
createProgram(rootNames, options, oldProgram, projectReferences) { | ||
options = Object.assign(Object.assign({}, options), { suppressOutputPathCheck: true }); | ||
options = { ...options, suppressOutputPathCheck: true }; | ||
this.compilerOptions = options; | ||
@@ -195,0 +195,0 @@ this.moduleResolutionCache = ts.createModuleResolutionCache(this.cwd, this.getCanonicalFileName, options); |
@@ -42,4 +42,4 @@ "use strict"; | ||
if (options.project.length === 0 && options.files.length !== 0) | ||
return this.lintFiles(Object.assign(Object.assign({}, options), { files, exclude }), config, linterOptions); | ||
return this.lintProject(Object.assign(Object.assign({}, options), { files, exclude }), config, linterOptions); | ||
return this.lintFiles({ ...options, files, exclude }, config, linterOptions); | ||
return this.lintProject({ ...options, files, exclude }, config, linterOptions); | ||
} | ||
@@ -46,0 +46,0 @@ *lintProject(options, config, linterOptions) { |
@@ -39,3 +39,3 @@ "use strict"; | ||
} | ||
catch (_a) { | ||
catch { | ||
return 0 /* NonExistent */; | ||
@@ -102,3 +102,3 @@ } | ||
} | ||
catch (_a) { | ||
catch { | ||
const parent = this.fs.normalizePath(path.dirname(dir)); | ||
@@ -105,0 +105,0 @@ if (parent === dir) |
@@ -137,3 +137,8 @@ "use strict"; | ||
const prev = receiver.get(ruleName); | ||
receiver.set(ruleName, Object.assign(Object.assign({ severity: 'error', options: undefined }, prev), config)); | ||
receiver.set(ruleName, { | ||
severity: 'error', | ||
options: undefined, | ||
...prev, | ||
...config, | ||
}); | ||
} | ||
@@ -140,0 +145,0 @@ } |
import { BuiltinResolver, Resolver } from '@fimbul/ymir'; | ||
export declare class DefaultBuiltinResolver implements BuiltinResolver { | ||
private resolver; | ||
private readonly builtinPackagePath; | ||
private get builtinPackagePath(); | ||
constructor(resolver: Resolver); | ||
@@ -6,0 +6,0 @@ resolveConfig(name: string): string; |
@@ -190,6 +190,6 @@ "use strict"; | ||
if (parent) { | ||
receiver.set(entry[0], Object.assign(Object.assign({}, parent), result)); | ||
receiver.set(entry[0], { ...parent, ...result }); | ||
} | ||
else { | ||
receiver.set(entry[0], Object.assign(Object.assign({}, result), resolveNameAndDirectories(name, rulesDirectoryMap))); | ||
receiver.set(entry[0], { ...result, ...resolveNameAndDirectories(name, rulesDirectoryMap) }); | ||
} | ||
@@ -212,3 +212,3 @@ } | ||
const alias = aliases && aliases.get(ruleName); | ||
result.set(ruleName, Object.assign(Object.assign({}, (alias || resolveNameAndDirectories(ruleName, rulesDirectoryMap))), mapRuleConfig(raw[ruleName]))); | ||
result.set(ruleName, { ...(alias || resolveNameAndDirectories(ruleName, rulesDirectoryMap)), ...mapRuleConfig(raw[ruleName]) }); | ||
} | ||
@@ -215,0 +215,0 @@ return result; |
@@ -17,3 +17,3 @@ "use strict"; | ||
} | ||
catch (_a) { | ||
catch { | ||
return; | ||
@@ -27,3 +27,3 @@ } | ||
} | ||
catch (_a) { | ||
catch { | ||
return; | ||
@@ -30,0 +30,0 @@ } |
@@ -175,3 +175,6 @@ "use strict"; | ||
createPosition(pos) { | ||
return Object.assign({ position: pos }, ts.getLineAndCharacterOfPosition(this.sourceFile, pos)); | ||
return { | ||
position: pos, | ||
...ts.getLineAndCharacterOfPosition(this.sourceFile, pos), | ||
}; | ||
} | ||
@@ -178,0 +181,0 @@ createFinding(message, severity, location, fixLocation = location) { |
@@ -8,4 +8,4 @@ import { Resolver, DirectoryService } from '@fimbul/ymir'; | ||
constructor(fs: CachedFileSystem, directories: DirectoryService); | ||
getDefaultExtensions(): ReadonlyArray<string>; | ||
resolve(id: string, basedir?: string, extensions?: ReadonlyArray<string>, paths?: ReadonlyArray<string>): string; | ||
getDefaultExtensions(): readonly string[]; | ||
resolve(id: string, basedir?: string, extensions?: readonly string[], paths?: ReadonlyArray<string>): string; | ||
require(id: string, options?: { | ||
@@ -12,0 +12,0 @@ cache?: boolean; |
@@ -24,2 +24,3 @@ "use strict"; | ||
readFileSync: (file) => this.fs.readFile(file), | ||
isDirectory: (file) => this.fs.isDirectory(file), | ||
}); | ||
@@ -26,0 +27,0 @@ } |
@@ -19,3 +19,3 @@ "use strict"; | ||
} | ||
catch (_a) { | ||
catch { | ||
return; | ||
@@ -30,3 +30,3 @@ } | ||
} | ||
catch (_a) { | ||
catch { | ||
return; | ||
@@ -33,0 +33,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
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
333935
4163
+ Added@fimbul/mimir@0.22.0-dev.20200101(transitive)
+ Addedsemver@7.7.1(transitive)
- Removed@fimbul/mimir@0.22.0-dev.20191111(transitive)
- Removedsemver@6.3.1(transitive)
Updatedresolve@^1.14.1
Updatedsemver@^7.0.0