diff --git a/lib/eslint.js b/lib/eslint.js index a26f5eb1..075bf6f2 100755 --- a/lib/eslint.js +++ b/lib/eslint.js @@ -230,23 +230,35 @@ async function run(console, runOptions) { } function logInfo() { - const printList = function(list) { - const [first, ...rest] = list.sort() - console.error("\t * " + first + rest.join("\n\t * ")) + const modulesList = function(list) { + const filteredList = list.filter(item => item !== undefined).sort(); + + if (filteredList.length === 0) return; + + return filteredList.map(item => "\t * " + item).join("\n"); } - console.error("Ignoring the following rules that rely on module resolution:") - printList(patch.disabledRules()) + let disabledRules = modulesList(patch.disabledRules()); + if (disabledRules ) { + console.error("Ignoring the following rules that rely on module resolution:"); + console.error(disabledRules); + } - console.error("Ignoring the following settings that rely on module resolution:") - printList(patch.removedSettings()) + const removedSettings = modulesList(patch.removedSettings()); + if (removedSettings ) { + console.error("Ignoring the following settings that rely on module resolution:") + console.error(removedSettings); + } - console.error("Skipped modules") - printList(patch.skippedModules()) + const skippedModules = modulesList(patch.skippedModules()); + if (skippedModules) { + console.error("Skipping the following modules that rely on module resolution:") + printList(skippedModules); + } if (debug) { console.error("Loaded modules") - printList(patch.loadedModules()) + console.error(patch.loadedModules()) } } diff --git a/package.json b/package.json index 13da6bed..e3ecdfc1 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "eslint-plugin-es5": "^1.2.0", "eslint-plugin-eslint-comments": "^3.1.1", "eslint-plugin-filenames": "^1.3.2", - "eslint-plugin-flowtype": "^3.9.1", + "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-formatjs": "^2.17.9", "eslint-plugin-html": "^4.0.6", "eslint-plugin-import": "^2.17.3", diff --git a/yarn.lock b/yarn.lock index bd27b23f..1c06d7fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4073,12 +4073,13 @@ eslint-plugin-flowtype@2.35.1: dependencies: lodash "^4.15.0" -eslint-plugin-flowtype@^3.9.1: - version "3.13.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz#e241ebd39c0ce519345a3f074ec1ebde4cf80f2c" - integrity sha512-bhewp36P+t7cEV0b6OdmoRWJCBYRiHFlqPZAG1oS3SF+Y0LQkeDvFSM4oxoxvczD1OdONCXMlJfQFiWLcV9urw== +eslint-plugin-flowtype@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz#e1557e37118f24734aa3122e7536a038d34a4912" + integrity sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ== dependencies: - lodash "^4.17.15" + lodash "^4.17.21" + string-natural-compare "^3.0.1" eslint-plugin-formatjs@^2.17.9: version "2.21.0" @@ -7976,6 +7977,11 @@ string-hash@1.1.3: resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b" integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs= +string-natural-compare@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" + integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"