Skip to content

Commit

Permalink
Merge pull request #372 from hicom150/update_eslint_dependencies
Browse files Browse the repository at this point in the history
Update eslint dependencies
  • Loading branch information
johnjbarton committed Apr 4, 2019
2 parents ac445f1 + a6b0f17 commit 14c8cba
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,6 +1,5 @@
language: node_js
node_js:
- 6
- 8
- 10

Expand Down
15 changes: 7 additions & 8 deletions lib/preprocessor.js
Expand Up @@ -13,7 +13,6 @@ var _ = require('lodash')
var SourceMapConsumer = require('source-map').SourceMapConsumer
var SourceMapGenerator = require('source-map').SourceMapGenerator
var globalSourceCache = require('./source-cache')
var extend = require('util')._extend
var coverageMap = require('./coverage-map')

// Regexes
Expand All @@ -29,13 +28,13 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera
// -------

var instrumenterOverrides = {}
var instrumenters = {istanbul: istanbul}
var instrumenters = { istanbul: istanbul }
var includeAllSources = false
var useJSExtensionForCoffeeScript = false

if (coverageReporter) {
instrumenterOverrides = coverageReporter.instrumenter
instrumenters = extend({istanbul: istanbul}, coverageReporter.instrumenters)
instrumenters = Object.assign({}, { istanbul: istanbul }, coverageReporter.instrumenters)
includeAllSources = coverageReporter.includeAllSources === true
useJSExtensionForCoffeeScript = coverageReporter.useJSExtensionForCoffeeScript === true
}
Expand Down Expand Up @@ -84,7 +83,7 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera
var instrumenterLiteral = 'istanbul'

_.forEach(instrumenterOverrides, function (literal, pattern) {
if (minimatch(file.originalPath, pattern, {dot: true})) {
if (minimatch(file.originalPath, pattern, { dot: true })) {
instrumenterLiteral = String(literal)
}
})
Expand All @@ -95,7 +94,7 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera

if (file.sourceMap) {
log.debug('Enabling source map generation for "%s".', file.originalPath)
codeGenerationOptions = extend({
codeGenerationOptions = Object.assign({}, {
format: {
compact: !constructOptions.noCompact
},
Expand All @@ -105,8 +104,8 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera
}, constructOptions.codeGenerationOptions || {})
}

var options = extend({}, constructOptions)
options = extend(options, {codeGenerationOptions: codeGenerationOptions})
var options = Object.assign({}, constructOptions)
options = Object.assign({}, options, { codeGenerationOptions: codeGenerationOptions })

var instrumenter = new InstrumenterConstructor(options)
instrumenter.instrument(content, jsPath, function (err, instrumentedCode) {
Expand All @@ -120,7 +119,7 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera
generator.applySourceMap(new SourceMapConsumer(file.sourceMap))
file.sourceMap = JSON.parse(generator.toString())
instrumentedCode += '\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,'
instrumentedCode += new Buffer(JSON.stringify(file.sourceMap)).toString('base64') + '\n'
instrumentedCode += Buffer.from(JSON.stringify(file.sourceMap)).toString('base64') + '\n'
}

// remember the actual immediate instrumented JS for given original path
Expand Down
10 changes: 5 additions & 5 deletions lib/reporter.js
Expand Up @@ -98,7 +98,7 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) {
Object.keys(covObj).forEach(function (key) {
// Do any patterns match the resolved key
var found = patterns.some(function (pattern) {
return minimatch(normalize(key), pattern, {dot: true})
return minimatch(normalize(key), pattern, { dot: true })
})

// if no patterns match, keep the key
Expand All @@ -115,7 +115,7 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) {

// First match wins
Object.keys(overrides).some(function (pattern) {
if (minimatch(normalize(key), pattern, {dot: true})) {
if (minimatch(normalize(key), pattern, { dot: true })) {
thresholds = overrides[pattern]
return true
}
Expand Down Expand Up @@ -283,7 +283,7 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) {
})
var reporter = istanbul.Report.create(reporterConfig.type || 'html', options)

// If reporting to console or in-memory skip directory creation
// If reporting to console or in-memory skip directory creation
var toDisk = !reporterConfig.type || !reporterConfig.type.match(/^(text|text-summary|in-memory)$/)
var hasNoFile = _.isUndefined(reporterConfig.file)

Expand All @@ -307,8 +307,8 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) {
if (pendingFileWritings) {
fileWritingFinished = (
typeof config._onExit === 'function'
? (function (done) { return function () { config._onExit(done) } }(done))
: done
? (function (done) { return function () { config._onExit(done) } }(done))
: done
)
} else {
(typeof config._onExit === 'function' ? config._onExit(done) : done())
Expand Down
17 changes: 11 additions & 6 deletions package.json
Expand Up @@ -28,17 +28,19 @@
"license": "MIT",
"devDependencies": {
"chai": "^3.3.0",
"eslint": "^2.2.0",
"eslint-config-standard": "^5.1.0",
"eslint-plugin-promise": "^1.1.0",
"eslint-plugin-react": "^4.1.0",
"eslint-plugin-standard": "^1.1.0",
"eslint": "^5.15.2",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-standard": "^4.0.0",
"grunt": "^0.4.5",
"grunt-bump": "^0.7.0",
"grunt-cli": "^1.2.0",
"grunt-conventional-changelog": "^6.1.0",
"grunt-conventional-github-releaser": "^1.0.0",
"grunt-eslint": "^18.0.0",
"grunt-eslint": "^21.0.0",
"grunt-karma": "1.x || ^0.12.0",
"grunt-npm": "^0.0.2",
"grunt-simple-mocha": "^0.4.0",
Expand All @@ -55,6 +57,9 @@
"sinon": "^1.14.1",
"sinon-chai": "^2.8.0"
},
"engines": {
"node": ">=8.0.0"
},
"contributors": [
"dignifiedquire <dignifiedquire@gmail.com>",
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
Expand Down

0 comments on commit 14c8cba

Please sign in to comment.