Skip to content

Commit f513948

Browse files
authored
Chore: Enable untyped-type-import warnings for Flow (#4151)
**Summary** Enables one of the new lint warnings in Flow. Others are left out because they are too noisy to be useful at the time, without and easy override. **Test plan** Lint should pass.
1 parent 116275c commit f513948

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

.flowconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111

1212
[libs]
1313

14+
[lints]
15+
untyped-type-import=warn
16+
1417
[options]
1518
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
1619
unsafe.enable_getters_and_setters=true
20+
include_warnings=true
1721

1822
[version]
1923
^0.52.0

__tests__/commands/install/bin-links.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ function execCommand(cwd: string, binPath: Array<string>, args: Array<string>):
3838
if (error) {
3939
reject({error, stdout});
4040
} else {
41-
const stdoutLines = stdout
42-
.toString()
43-
.split('\n')
44-
.map((line: ?string) => line && line.trim())
45-
.filter((line: ?string) => line);
46-
47-
resolve(stdoutLines);
41+
resolve(stdout.toString().split('\n').map(line => line.trim()).filter(line => line));
4842
}
4943
},
5044
);

src/lockfile/stringify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function maybeWrap(str: string | boolean | number): string {
2424
}
2525
}
2626

27-
const priorities: {[key: string]: ?number} = {
27+
const priorities: {[key: string]: number} = {
2828
name: 1,
2929
version: 2,
3030
uid: 3,

src/util/request-manager.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as network from './network.js';
88
import map from '../util/map.js';
99

1010
import typeof * as RequestModuleT from 'request';
11-
import type RequestT from 'request';
1211

1312
const RequestCaptureHar = require('request-capture-har');
1413
const invariant = require('invariant');
@@ -50,7 +49,7 @@ type RequestParams<T> = {
5049
headers?: {
5150
[name: string]: string,
5251
},
53-
process?: (req: RequestT, resolve: (body: T) => void, reject: (err: Error) => void) => void,
52+
process?: (req: Object, resolve: (body: T) => void, reject: (err: Error) => void) => void,
5453
callback?: (err: ?Error, res: any, body: any) => void,
5554
retryAttempts?: number,
5655
maxRetryAttempts?: number,

0 commit comments

Comments
 (0)