Skip to content

Commit

Permalink
Chore: Enable untyped-type-import warnings for Flow (#4151)
Browse files Browse the repository at this point in the history
**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.
  • Loading branch information
BYK authored Aug 13, 2017
1 parent 116275c commit f513948
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@

[libs]

[lints]
untyped-type-import=warn

[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
unsafe.enable_getters_and_setters=true
include_warnings=true

[version]
^0.52.0
8 changes: 1 addition & 7 deletions __tests__/commands/install/bin-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ function execCommand(cwd: string, binPath: Array<string>, args: Array<string>):
if (error) {
reject({error, stdout});
} else {
const stdoutLines = stdout
.toString()
.split('\n')
.map((line: ?string) => line && line.trim())
.filter((line: ?string) => line);

resolve(stdoutLines);
resolve(stdout.toString().split('\n').map(line => line.trim()).filter(line => line));
}
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/lockfile/stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function maybeWrap(str: string | boolean | number): string {
}
}

const priorities: {[key: string]: ?number} = {
const priorities: {[key: string]: number} = {
name: 1,
version: 2,
uid: 3,
Expand Down
3 changes: 1 addition & 2 deletions src/util/request-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as network from './network.js';
import map from '../util/map.js';

import typeof * as RequestModuleT from 'request';
import type RequestT from 'request';

const RequestCaptureHar = require('request-capture-har');
const invariant = require('invariant');
Expand Down Expand Up @@ -50,7 +49,7 @@ type RequestParams<T> = {
headers?: {
[name: string]: string,
},
process?: (req: RequestT, resolve: (body: T) => void, reject: (err: Error) => void) => void,
process?: (req: Object, resolve: (body: T) => void, reject: (err: Error) => void) => void,
callback?: (err: ?Error, res: any, body: any) => void,
retryAttempts?: number,
maxRetryAttempts?: number,
Expand Down

0 comments on commit f513948

Please sign in to comment.