Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fimbul/wotan

Package Overview
Dependencies
Maintainers
2
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fimbul/wotan - npm Package Compare versions

Comparing version 0.11.0-dev.20180610 to 0.11.0-dev.20180611

2

package.json
{
"name": "@fimbul/wotan",
"version": "0.11.0-dev.20180610",
"version": "0.11.0-dev.20180611",
"description": "Pluggable TypeScript and JavaScript linter",

@@ -5,0 +5,0 @@ "bin": "bin/main.js",

@@ -36,2 +36,5 @@ import { Linter } from './linter';

}
interface SourceFile {
parseDiagnostics: ts.DiagnosticWithLocation[];
}
}

@@ -16,2 +16,4 @@ "use strict";

const project_host_1 = require("./project-host");
const debug = require("debug");
const log = debug('wotan:runner');
let Runner = class Runner {

@@ -46,7 +48,8 @@ constructor(fs, configManager, linter, processorLoader, directories, logger) {

let summary;
if (options.fix) {
const fix = shouldFix(sourceFile, options, originalName);
if (fix) {
summary = this.linter.lintAndFix(sourceFile, originalContent, effectiveConfig, (content, range) => {
({ sourceFile, program } = processorHost.updateSourceFile(sourceFile, program, content, range));
return { program, file: sourceFile };
}, options.fix === true ? undefined : options.fix, program, mapped === undefined ? undefined : mapped.processor);
}, fix === true ? undefined : fix, program, mapped === undefined ? undefined : mapped.processor);
}

@@ -107,8 +110,9 @@ else {

let sourceFile = ts.createSourceFile(name, content, ts.ScriptTarget.ESNext, true);
const fix = shouldFix(sourceFile, options, file);
let summary;
if (options.fix) {
if (fix) {
summary = this.linter.lintAndFix(sourceFile, originalContent, effectiveConfig, (newContent, range) => {
sourceFile = ts.updateSourceFile(sourceFile, newContent, range);
return { file: sourceFile };
}, options.fix === true ? undefined : options.fix, undefined, processor);
}, fix === true ? undefined : fix, undefined, processor);
}

@@ -243,2 +247,12 @@ else {

}
function hasParseErrors(sourceFile) {
return sourceFile.parseDiagnostics.length !== 0;
}
function shouldFix(sourceFile, options, originalName) {
if (options.fix && hasParseErrors(sourceFile)) {
log("Not fixing '%s' because of parse errors.", originalName);
return false;
}
return options.fix;
}
function createParseConfigHost(host) {

@@ -245,0 +259,0 @@ return {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc