Comparing version 2.0.2 to 2.0.3
17
index.js
#!/usr/bin/env node | ||
const spawnSync = require('child_process').spawnSync; | ||
var lintFileGroup = require('./lib/lintFileGroup'); | ||
var lintGitFiles = require('./lib/lintGitFiles'); | ||
var opt = require('node-getopt').create([ | ||
const lintFileGroup = require('./lib/lintFileGroup'); | ||
const lintGitFiles = require('./lib/lintGitFiles'); | ||
const opt = require('node-getopt').create([ | ||
['w', 'warnings', 'enable warnings'], | ||
@@ -10,3 +11,5 @@ ['e', 'es6', 'allow es6 in .js files'], | ||
['', 'root[=path]', 'look for js files in this directory'], | ||
['h', 'help', 'display this help'] | ||
['h', 'help', 'display this help'], | ||
['f', 'format=format', 'set output format'], | ||
['v', 'version', 'display eslint version info'] | ||
]) | ||
@@ -16,3 +19,7 @@ .bindHelp() | ||
if (opt.options.git) { | ||
if (opt.options.version) { | ||
const esLintVer = spawnSync('eslint', ['-v']); | ||
process.stdout.write(esLintVer.stdout); | ||
process.exit(); | ||
} else if (opt.options.git) { | ||
process.exit(lintGitFiles(opt)); | ||
@@ -19,0 +26,0 @@ } else { |
@@ -44,4 +44,8 @@ /** | ||
if (opt.options.format) { | ||
args.push('--format=' + opt.options.format); | ||
} | ||
return args; | ||
} | ||
}; |
{ | ||
"name": "dibslint", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "1stdibs custom linting", | ||
@@ -5,0 +5,0 @@ "author": "1stdibs <npm@1stdibs.com> (https://1stdibs.com)", |
8748
14
237
3