From 79ce006af5ec572baad7ca7cf889b5ca0b1f73fa Mon Sep 17 00:00:00 2001 From: Stephanemw Date: Thu, 25 Oct 2018 09:38:31 +0100 Subject: [PATCH] chore(deps): update lodash, mocha away from vulnerable versions (#175) * chore(deps): update lodash, mocha away from vulnerable versions, fix associated code and npm scripts, update tslint config * chore(config): use full es2015 instead of 2015.core+es2016 in tsconfig libs --- package.json | 16 +++++----------- src/FilesWatcher.ts | 2 +- src/IncrementalChecker.ts | 2 +- src/index.ts | 4 ++-- src/tsconfig.json | 2 +- src/tslint.json | 4 +++- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 816e26ee..ca410d34 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ ], "scripts": { "build": "tsc --version && tsc --project \"./src\"", - "test:unit": "mocha -R spec ./test/unit", - "test:integration": "mocha -R spec ./test/integration && rimraf tmp", + "test:unit": "mocha -R spec ./test/unit --exit", + "test:integration": "mocha -R spec ./test/integration --exit && rimraf tmp", "test": "npm run build && npm run test:unit && npm run test:integration", "test:watch": "mocha -R spec --watch ./test/unit", "test:coverage": "rimraf coverage && istanbul cover -root lib --include-all-sources mocha -- -R spec ./test/unit ./test/integration", @@ -51,10 +51,7 @@ "devDependencies": { "@types/babel-code-frame": "^6.20.1", "@types/chokidar": "^1.7.5", - "@types/lodash.endswith": "^4.2.3", - "@types/lodash.isfunction": "^3.0.3", - "@types/lodash.isstring": "^4.0.3", - "@types/lodash.startswith": "^4.2.3", + "@types/lodash": "^4.14.117", "@types/minimatch": "^3.0.1", "@types/node": "^8.0.26", "@types/resolve": "0.0.4", @@ -65,7 +62,7 @@ "husky": "^1.1.2", "istanbul": "^0.4.5", "lint-staged": "^7.3.0", - "mocha": "^3.4.1", + "mocha": "^5.2.0", "mock-fs": "^4.3.0", "mock-require": "^2.0.2", "prettier": "^1.14.3", @@ -90,10 +87,7 @@ "babel-code-frame": "^6.22.0", "chalk": "^2.4.1", "chokidar": "^2.0.4", - "lodash.endswith": "^4.2.1", - "lodash.isfunction": "^3.0.8", - "lodash.isstring": "^4.0.1", - "lodash.startswith": "^4.2.1", + "lodash": "^4.17.11", "minimatch": "^3.0.4", "resolve": "^1.5.0", "tapable": "^1.0.0" diff --git a/src/FilesWatcher.ts b/src/FilesWatcher.ts index 54a1e279..67032ade 100644 --- a/src/FilesWatcher.ts +++ b/src/FilesWatcher.ts @@ -1,6 +1,6 @@ import * as chokidar from 'chokidar'; import * as path from 'path'; -import startsWith = require('lodash.startswith'); +import startsWith = require('lodash/startsWith'); export class FilesWatcher { watchPaths: string[]; diff --git a/src/IncrementalChecker.ts b/src/IncrementalChecker.ts index 0104ee28..69b626ad 100644 --- a/src/IncrementalChecker.ts +++ b/src/IncrementalChecker.ts @@ -1,5 +1,5 @@ import * as fs from 'fs'; -import endsWith = require('lodash.endswith'); +import endsWith = require('lodash/endsWith'); import * as path from 'path'; import * as ts from 'typescript'; import { Configuration, Linter } from 'tslint'; // Imported for types alone; actual requires take place in methods below diff --git a/src/index.ts b/src/index.ts index ee51aaa7..52bf7a5c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,8 +5,8 @@ import chalk, { Chalk } from 'chalk'; import * as fs from 'fs'; import * as os from 'os'; import * as webpack from 'webpack'; -import isString = require('lodash.isstring'); -import isFunction = require('lodash.isfunction'); +import isString = require('lodash/isString'); +import isFunction = require('lodash/isFunction'); import { CancellationToken } from './CancellationToken'; import { NormalizedMessage } from './NormalizedMessage'; import { createDefaultFormatter } from './formatter/defaultFormatter'; diff --git a/src/tsconfig.json b/src/tsconfig.json index cf43f6e6..cccc7a14 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -8,7 +8,7 @@ "noUnusedParameters": true, "suppressImplicitAnyIndexErrors": true, "strictNullChecks": false, - "lib": ["es5", "es2015.core", "dom"], + "lib": ["es5", "es2015", "dom"], "module": "commonjs", "moduleResolution": "node", "declaration": true, diff --git a/src/tslint.json b/src/tslint.json index a02f3879..0f3098a4 100644 --- a/src/tslint.json +++ b/src/tslint.json @@ -22,6 +22,8 @@ "allow-pascal-case" ], "no-namespace": false, - "array-type": [true, "array"] + "array-type": [true, "array"], + "no-submodule-imports": [true, "lodash"] + } }