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

Commit c764954

Browse files
committed
Remove Prettier
1 parent 914150e commit c764954

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;
@@ -486,11 +485,10 @@ function makeJsonCheckerFromCore(requiredForm: any, ignoredKeys: string[], requi
486485

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

0 commit comments

Comments
 (0)