deps: upgrade `prettier@1.19.1` (#1439)

Summary:
Most changes due to <https://github.com/prettier/prettier/pull/6694>.

Generated with `yarn add prettier@1.19.1 && yarn prettify`.

Test Plan:
Running `yarn test` suffices.

wchargin-branch: prettier-v1.19.1
This commit is contained in:
William Chargin 2019-11-11 12:47:26 -08:00 committed by GitHub
parent 64834c6874
commit c07a3fe208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 96 additions and 31 deletions

View File

@ -66,7 +66,7 @@
"flow-bin": "^0.111.0",
"jest": "^24.8.0",
"jest-fetch-mock": "^2.1.2",
"prettier": "1.18.2",
"prettier": "1.19.1",
"raf": "3.4.1",
"react-dev-utils": "^5.0.0",
"static-site-generator-webpack-plugin": "^3.4.1",

View File

@ -25,7 +25,10 @@ describe("src/analysis/timeline/timelinePagerank", () => {
const expected = [
new Map([[foo.address, 2]]),
new Map([[foo.address, 1]]),
new Map([[foo.address, 0.5], [bar.address, 0.5]]),
new Map([
[foo.address, 0.5],
[bar.address, 0.5],
]),
];
expect(weights).toEqual(expected);
});

View File

@ -34,7 +34,11 @@ describe("core/attribution/markovChain", () => {
describe("sparseMarkovChainFromTransitionMatrix", () => {
it("works for a simple matrix", () => {
const matrix = [[1, 0, 0], [0.25, 0, 0.75], [0.25, 0.75, 0]];
const matrix = [
[1, 0, 0],
[0.25, 0, 0.75],
[0.25, 0.75, 0],
];
const chain = sparseMarkovChainFromTransitionMatrix(matrix);
const expected = [
{
@ -80,7 +84,11 @@ describe("core/attribution/markovChain", () => {
});
it("rejects a matrix with negative entries", () => {
const matrix = [[1, 0, 0], [-0.5, 0.75, 0.75], [0, 0, 1]];
const matrix = [
[1, 0, 0],
[-0.5, 0.75, 0.75],
[0, 0, 1],
];
expect(() => sparseMarkovChainFromTransitionMatrix(matrix)).toThrow(
/positive real.*-0.5/
);
@ -101,7 +109,10 @@ describe("core/attribution/markovChain", () => {
});
it("rejects a non-stochastic matrix", () => {
const matrix = [[1, 0], [0.125, 0.625]];
const matrix = [
[1, 0],
[0.125, 0.625],
];
expect(() => sparseMarkovChainFromTransitionMatrix(matrix)).toThrow(
/sums to 0.75/
);
@ -338,7 +349,10 @@ describe("core/attribution/markovChain", () => {
});
it("finds the stationary distribution of a periodic chain", async () => {
const chain = sparseMarkovChainFromTransitionMatrix([[0, 1], [1, 0]]);
const chain = sparseMarkovChainFromTransitionMatrix([
[0, 1],
[1, 0],
]);
const params: PagerankParams = {
chain,
alpha: 0,
@ -359,7 +373,10 @@ describe("core/attribution/markovChain", () => {
});
it("returns initial distribution if maxIterations===0", async () => {
const chain = sparseMarkovChainFromTransitionMatrix([[0, 1], [0, 1]]);
const chain = sparseMarkovChainFromTransitionMatrix([
[0, 1],
[0, 1],
]);
const params: PagerankParams = {
chain,
alpha: 0,

View File

@ -994,7 +994,10 @@ describe("core/graph", () => {
Direction.IN,
[],
[],
[{node: loop, edge: loop_loop}, {node: foo, edge: foo_loop}]
[
{node: loop, edge: loop_loop},
{node: foo, edge: foo_loop},
]
);
});
it("OUT", () => {
@ -1076,7 +1079,10 @@ describe("core/graph", () => {
it("works for a proper prefix match", () => {
edgeExpectNeighbors(
["foo"],
[{node: foo, edge: foo_loop}, {node: foo, edge: loop_foo}]
[
{node: foo, edge: foo_loop},
{node: foo, edge: loop_foo},
]
);
});
it("works when there are no matching edges", () => {

View File

@ -29,7 +29,11 @@ export class NodeRowList extends React.PureComponent<NodeRowListProps> {
const {pnd, maxEntriesPerList} = sharedProps;
return (
<React.Fragment>
{sortBy(nodes, (n) => -NullUtil.get(pnd.get(n)).score, (n) => n)
{sortBy(
nodes,
(n) => -NullUtil.get(pnd.get(n)).score,
(n) => n
)
.slice(0, maxEntriesPerList)
.map((node) => (
<NodeRow

View File

@ -861,9 +861,10 @@ export class Mirror {
case "UNION":
return [
b.field("__typename"),
...this._schemaInfo.unionTypes[typename].clauses.map(
(clause: Schema.Typename) =>
b.inlineFragment(clause, [b.field("id")])
...this._schemaInfo.unionTypes[
typename
].clauses.map((clause: Schema.Typename) =>
b.inlineFragment(clause, [b.field("id")])
),
];
// istanbul ignore next

View File

@ -2195,7 +2195,10 @@ describe("graphql/mirror", () => {
"ORDER BY o_id ASC"
)
.all()
).toEqual([{o_id: "dos", p_rowid: null}, {o_id: "uno", p_rowid: null}]);
).toEqual([
{o_id: "dos", p_rowid: null},
{o_id: "uno", p_rowid: null},
]);
expect(
db
.prepare("SELECT * FROM links ORDER BY parent_id ASC")

View File

@ -231,7 +231,12 @@ describe("plugins/discourse/mirror", () => {
});
function expectLikesSorted(as, bs) {
const s = (ls) => sortBy(ls, (x) => x.username, (x) => x.postId);
const s = (ls) =>
sortBy(
ls,
(x) => x.username,
(x) => x.postId
);
expect(s(as)).toEqual(s(bs));
}

View File

@ -82,9 +82,9 @@ describe("plugins/github/parseReferences", () => {
]);
});
it("a link with surrounding context", () => {
expect(parseReferences("please see sourcecred/example_.repo#12")).toEqual(
[{refType: "BASIC", ref: repoRef}]
);
expect(
parseReferences("please see sourcecred/example_.repo#12")
).toEqual([{refType: "BASIC", ref: repoRef}]);
});
});

View File

@ -295,9 +295,11 @@ export class RelationalView {
issues: expectAllNonNull(json, "issues", json.issues).map((x) =>
this._addIssue(address, x)
),
pulls: expectAllNonNull(json, "pullRequests", json.pullRequests).map(
(x) => this._addPull(address, x)
),
pulls: expectAllNonNull(
json,
"pullRequests",
json.pullRequests
).map((x) => this._addPull(address, x)),
timestampMs: +new Date(json.createdAt),
};
const raw = N.toRaw(address);

View File

@ -57,12 +57,36 @@ describe("plugins/github/relationalView", () => {
});
});
}
hasEntityMethods("repos", () => view.repos(), (x) => view.repo(x));
hasEntityMethods("issues", () => view.issues(), (x) => view.issue(x));
hasEntityMethods("pulls", () => view.pulls(), (x) => view.pull(x));
hasEntityMethods("reviews", () => view.reviews(), (x) => view.review(x));
hasEntityMethods("comments", () => view.comments(), (x) => view.comment(x));
hasEntityMethods("commits", () => view.commits(), (x) => view.commit(x));
hasEntityMethods(
"repos",
() => view.repos(),
(x) => view.repo(x)
);
hasEntityMethods(
"issues",
() => view.issues(),
(x) => view.issue(x)
);
hasEntityMethods(
"pulls",
() => view.pulls(),
(x) => view.pull(x)
);
hasEntityMethods(
"reviews",
() => view.reviews(),
(x) => view.review(x)
);
hasEntityMethods(
"comments",
() => view.comments(),
(x) => view.comment(x)
);
hasEntityMethods(
"commits",
() => view.commits(),
(x) => view.commit(x)
);
hasEntityMethods(
"userlikes",
() => view.userlikes(),

View File

@ -6740,10 +6740,10 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
prettier@1.18.2:
version "1.18.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
prettier@1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
pretty-format@^24.8.0:
version "24.8.0"