Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 4fea6f7

Browse files
committed
Remove Prettier
1 parent f8b99aa commit 4fea6f7

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"idembot": "^0.0.12",
3535
"moment": "^2.27.0",
3636
"node-fetch": "^2.6.1",
37-
"prettier": "^2.2.0",
3837
"prettyjson": "^1.2.1",
3938
"request": "^2.88.2",
4039
"tslib": "^1.13.0",

src/pr-info.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import * as comment from "./util/comment";
2121
import * as urls from "./urls";
2222
import * as HeaderParser from "definitelytyped-header-parser";
2323
import * as jsonDiff from "fast-json-patch";
24-
import * as prettier from "prettier";
2524
import { PullRequestState } from "./schema/graphql-global-types";
2625

2726
const CriticalPopularityThreshold = 5_000_000;
@@ -483,11 +482,10 @@ function makeJsonCheckerFromCore(requiredForm: any, ignoredKeys: string[], requi
483482

484483
// Suggest the different lines to the author
485484
function makeJsonSuggestion() {
486-
const suggestionLines = (
487-
Object.keys(suggestion).length <= 1
488-
? prettier.format(JSON.stringify(suggestion), { tabWidth: 4, filepath: ".json" })
489-
: JSON.stringify(suggestion, undefined, 4) + "\n"
490-
).split(/^/m);
485+
const text = JSON.stringify(suggestion, undefined, 4);
486+
const suggestionLines = Object.keys(suggestion).length === 1
487+
? [text.replace(/\n */g, " ") + "\n"]
488+
: (text + "\n").split(/^/m);
491489
// "^" will match inside LineTerminatorSequence so
492490
// "\r\n".split(/^/m) is two lines. Sigh.
493491
// https://tc39.es/ecma262/#_ref_7303:~:text=the%20character%20Input%5Be%20%2D%201%5D%20is%20one%20of%20LineTerminator

0 commit comments

Comments
 (0)