New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.13.0-dev.20180807 to 0.13.0

14

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

@@ -37,3 +37,3 @@ "bin": "bin/main.js",

"@types/js-yaml": "^3.10.1",
"@types/json5": "0.0.29",
"@types/json5": "0.0.30",
"@types/minimatch": "^3.0.1",

@@ -45,2 +45,3 @@ "@types/mkdirp": "^0.5.2",

"@types/semver": "^5.4.0",
"@types/to-absolute-glob": "^2.0.0",
"escape-string-regexp": "^1.0.5",

@@ -50,4 +51,4 @@ "rimraf": "^2.6.2"

"dependencies": {
"@fimbul/mimir": "0.13.0-dev.20180803",
"@fimbul/ymir": "0.13.0-dev.20180802",
"@fimbul/mimir": "^0.13.0",
"@fimbul/ymir": "^0.13.0",
"bind-decorator": "^1.0.11",

@@ -62,3 +63,3 @@ "chalk": "^2.3.0",

"js-yaml": "^3.10.0",
"json5": "^1.0.0",
"json5": "^2.0.0",
"minimatch": "^3.0.4",

@@ -68,2 +69,3 @@ "reflect-metadata": "^0.1.12",

"semver": "^5.4.1",
"to-absolute-glob": "^2.0.2",
"tslib": "^1.8.1",

@@ -73,4 +75,4 @@ "tsutils": "^3.0.0"

"peerDependencies": {
"typescript": ">= 2.7.1 || >= 3.0.0-dev || >= 3.0.0-insiders || 3.0.0-rc || >= 3.1.0-dev"
"typescript": ">= 2.8.1 || >= 3.0.0-dev || >= 3.0.0-insiders || 3.0.0-rc || >= 3.1.0-dev"
}
}

@@ -37,3 +37,3 @@ # Wotan

wotan -p <path/to/tsconfig.json> # lint the whole project
wotan "src/**/*.ts" -e "**/*.d.ts" # lint all typescript files excluding declaration files
wotan 'src/**/*.ts' -e '**/*.d.ts' # lint all typescript files excluding declaration files
wotan --fix # lint the whole project and fix all fixable errors

@@ -146,2 +146,4 @@ ```

Note that all file paths are relative to the current working directory. Therefore `**/*.ts` doesn't match `../foo.ts`.
### Examples

@@ -148,0 +150,0 @@

@@ -11,3 +11,3 @@ "use strict";

return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (argv.length === 1 && /^(')?(?:-v|version)\1$/.test(argv[0]))
if (argv.length === 1 && /^(')?-(?:v|-version)\1$/.test(argv[0]))
return console.log(require('../package.json').version);

@@ -14,0 +14,0 @@ try {

@@ -17,2 +17,3 @@ "use strict";

const debug = require("debug");
const resolveGlob = require("to-absolute-glob");
const log = debug('wotan:runner');

@@ -30,5 +31,11 @@ let Runner = class Runner {

const config = options.config !== undefined ? this.configManager.loadLocalOrResolved(options.config) : undefined;
const resolveOptions = { cwd: this.directories.getCurrentDirectory() };
const files = options.files.map(resolve);
const exclude = options.exclude.map(resolve);
if (options.project === undefined && options.files.length !== 0)
return this.lintFiles(options, config);
return this.lintProject(options, config);
return this.lintFiles(Object.assign({}, options, { files, exclude }), config);
return this.lintProject(Object.assign({}, options, { files, exclude }), config);
function resolve(pattern) {
return resolveGlob(pattern, resolveOptions);
}
}

@@ -146,22 +153,13 @@ *lintProject(options, config) {

const ex = exclude.map((p) => new minimatch_1.Minimatch(p, { dot: true }));
const typeRoots = ts.getEffectiveTypeRoots(program.getCompilerOptions(), host);
outer: for (const sourceFile of program.getSourceFiles()) {
const typeRoots = ts.getEffectiveTypeRoots(program.getCompilerOptions(), host) || [];
for (const sourceFile of program.getSourceFiles()) {
const { fileName } = sourceFile;
if (fileName.startsWith(libDirectory) ||
fileName.endsWith('/node_modules/tslib/tslib.d.ts'))
fileName.endsWith('/node_modules/tslib/tslib.d.ts') ||
program.isSourceFileFromExternalLibrary(sourceFile) ||
!typeRoots.every((typeRoot) => path.relative(typeRoot, fileName).startsWith('..' + path.sep)))
continue;
if (program.isSourceFileFromExternalLibrary(sourceFile))
const originalName = host.getFileSystemFile(fileName);
if (include.length !== 0 && !include.some((e) => e.match(originalName)) || ex.some((e) => e.match(originalName)))
continue;
if (typeRoots !== undefined) {
for (const typeRoot of typeRoots) {
const relative = path.relative(typeRoot, fileName);
if (!relative.startsWith('..' + path.sep))
continue outer;
}
}
const originalName = path.relative(cwd, host.getFileSystemFile(fileName));
if (include.length !== 0 && !include.some((e) => e.match(originalName)))
continue;
if (ex.some((e) => e.match(originalName)))
continue;
files.push(fileName);

@@ -168,0 +166,0 @@ originalNames.push(originalName);

Sorry, the diff of this file is not supported yet

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