Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 13, 2019
1 parent d2faaef commit 072a421
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
9 changes: 6 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function start(cliConfig) {

try {
config = options(process.argv.slice(2), cliConfig)
} catch (err) {
return fail(err, true)
} catch (error) {
return fail(error, true)
}

if (config.help) {
Expand Down Expand Up @@ -144,7 +144,9 @@ function start(cliConfig) {

/* Print an error, optionally with stack. */
function fail(err, pretty) {
var message = (pretty ? String(err).trim() : err.stack) || err
var message =
(pretty ? String(err).trim() : err.stack) ||
/* istanbul ignore next - Old versions of Node */ err

exitStatus = 1

Expand All @@ -154,4 +156,5 @@ function fail(err, pretty) {
function onexit() {
/* eslint-disable unicorn/no-process-exit */
process.exit(exitStatus)
/* eslint-enable unicorn/no-process-exit */
}
6 changes: 3 additions & 3 deletions lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function options(flags, configuration) {
version: config.version,
files: config._,
watch: config.watch,
extensions: ext.length ? ext : configuration.extensions,
extensions: ext.length === 0 ? configuration.extensions : ext,
output: config.output,
out: config.stdout,
tree: config.tree,
Expand Down Expand Up @@ -149,9 +149,9 @@ function parseConfig(flags, cache) {

try {
flags = toCamelCase(parseJSON(flags))
} catch (err) {
} catch (error) {
/* Fix position */
message = err.message.replace(/at(?= position)/, 'around')
message = error.message.replace(/at(?= position)/, 'around')

throw fault('Cannot parse `%s` as JSON: %s', flags, message)
}
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
},
"devDependencies": {
"bail": "^1.0.0",
"execa": "^0.10.0",
"nyc": "^11.0.0",
"prettier": "^1.12.1",
"remark-cli": "^5.0.0",
"remark-preset-wooorm": "^4.0.0",
"strip-ansi": "^4.0.0",
"tape": "^4.4.0",
"execa": "^1.0.0",
"nyc": "^14.0.0",
"prettier": "^1.0.0",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^5.0.0",
"strip-ansi": "^5.0.0",
"tape": "^4.0.0",
"touch": "^3.0.0",
"unified": "^7.0.0",
"vfile-reporter-json": "^1.0.1",
"xo": "^0.21.0",
"xtend": "^4.0.1"
"vfile-reporter-json": "^2.0.0",
"xo": "^0.24.0",
"xtend": "^4.0.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix",
Expand Down
7 changes: 5 additions & 2 deletions test/fixtures/plugins/cli.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env node
'use strict'

var extend = require('xtend')
/* eslint-disable import/no-extraneous-dependencies */
var xtend = require('xtend')
/* eslint-enable import/no-extraneous-dependencies */

var start = require('../../..')
var config = require('../config')
var processor = require('../processor')

start(
extend(config, {
xtend(config, {
cwd: __dirname,
processor: processor
})
Expand Down
7 changes: 5 additions & 2 deletions test/fixtures/uncaught-errors/cli.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env node
'use strict'

var extend = require('xtend')
/* eslint-disable import/no-extraneous-dependencies */
var xtend = require('xtend')
/* eslint-enable import/no-extraneous-dependencies */

var start = require('../../..')
var config = require('../config')
var processor = require('../processor')

start(
extend(config, {
xtend(config, {
cwd: __dirname,
processor: processor
})
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/uncaught-errors/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ module.exports = function() {}
setTimeout(thrower, 1000)

function thrower() {
/* eslint-disable no-throw-literal */
throw 'foo'
/* eslint-enable no-throw-literal */
}

0 comments on commit 072a421

Please sign in to comment.