Skip to content

Commit 52bd670

Browse files
authored
Upgrade flowtype plugin (codeclimate#605)
1 parent 145c451 commit 52bd670

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

lib/eslint.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,23 +230,35 @@ async function run(console, runOptions) {
230230
}
231231

232232
function logInfo() {
233-
const printList = function(list) {
234-
const [first, ...rest] = list.sort()
235-
console.error("\t * " + first + rest.join("\n\t * "))
233+
const modulesList = function(list) {
234+
const filteredList = list.filter(item => item !== undefined).sort();
235+
236+
if (filteredList.length === 0) return;
237+
238+
return filteredList.map(item => "\t * " + item).join("\n");
236239
}
237240

238-
console.error("Ignoring the following rules that rely on module resolution:")
239-
printList(patch.disabledRules())
241+
let disabledRules = modulesList(patch.disabledRules());
242+
if (disabledRules ) {
243+
console.error("Ignoring the following rules that rely on module resolution:");
244+
console.error(disabledRules);
245+
}
240246

241-
console.error("Ignoring the following settings that rely on module resolution:")
242-
printList(patch.removedSettings())
247+
const removedSettings = modulesList(patch.removedSettings());
248+
if (removedSettings ) {
249+
console.error("Ignoring the following settings that rely on module resolution:")
250+
console.error(removedSettings);
251+
}
243252

244-
console.error("Skipped modules")
245-
printList(patch.skippedModules())
253+
const skippedModules = modulesList(patch.skippedModules());
254+
if (skippedModules) {
255+
console.error("Skipping the following modules that rely on module resolution:")
256+
printList(skippedModules);
257+
}
246258

247259
if (debug) {
248260
console.error("Loaded modules")
249-
printList(patch.loadedModules())
261+
console.error(patch.loadedModules())
250262
}
251263
}
252264

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"eslint-plugin-es5": "^1.2.0",
7474
"eslint-plugin-eslint-comments": "^3.1.1",
7575
"eslint-plugin-filenames": "^1.3.2",
76-
"eslint-plugin-flowtype": "^3.9.1",
76+
"eslint-plugin-flowtype": "^8.0.3",
7777
"eslint-plugin-formatjs": "^2.17.9",
7878
"eslint-plugin-html": "^4.0.6",
7979
"eslint-plugin-import": "^2.17.3",

yarn.lock

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4073,12 +4073,13 @@ [email protected]:
40734073
dependencies:
40744074
lodash "^4.15.0"
40754075

4076-
eslint-plugin-flowtype@^3.9.1:
4077-
version "3.13.0"
4078-
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz#e241ebd39c0ce519345a3f074ec1ebde4cf80f2c"
4079-
integrity sha512-bhewp36P+t7cEV0b6OdmoRWJCBYRiHFlqPZAG1oS3SF+Y0LQkeDvFSM4oxoxvczD1OdONCXMlJfQFiWLcV9urw==
4076+
eslint-plugin-flowtype@^8.0.3:
4077+
version "8.0.3"
4078+
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz#e1557e37118f24734aa3122e7536a038d34a4912"
4079+
integrity sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==
40804080
dependencies:
4081-
lodash "^4.17.15"
4081+
lodash "^4.17.21"
4082+
string-natural-compare "^3.0.1"
40824083

40834084
eslint-plugin-formatjs@^2.17.9:
40844085
version "2.21.0"
@@ -7976,6 +7977,11 @@ [email protected]:
79767977
resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"
79777978
integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=
79787979

7980+
string-natural-compare@^3.0.1:
7981+
version "3.0.1"
7982+
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
7983+
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==
7984+
79797985
string-width@^1.0.1:
79807986
version "1.0.2"
79817987
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"

0 commit comments

Comments
 (0)