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

Commit

Permalink
Remove Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Dec 22, 2020
1 parent f8b99aa commit 4fea6f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"idembot": "^0.0.12",
"moment": "^2.27.0",
"node-fetch": "^2.6.1",
"prettier": "^2.2.0",
"prettyjson": "^1.2.1",
"request": "^2.88.2",
"tslib": "^1.13.0",
Expand Down
10 changes: 4 additions & 6 deletions src/pr-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as comment from "./util/comment";
import * as urls from "./urls";
import * as HeaderParser from "definitelytyped-header-parser";
import * as jsonDiff from "fast-json-patch";
import * as prettier from "prettier";
import { PullRequestState } from "./schema/graphql-global-types";

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

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

0 comments on commit 4fea6f7

Please sign in to comment.