Skip to content
This repository was archived by the owner on Feb 11, 2021. It is now read-only.

Commit f53bcb9

Browse files
committed
chore: switched to prettier for formatting
1 parent 287349b commit f53bcb9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@
3333
"@babel/runtime": "^7.10.2",
3434
"@testing-library/dom": "^7.11.0",
3535
"crx-bridge": "^2.1.0",
36-
"js-beautify": "^1.11.0",
36+
"prettier": "^2.0.5",
3737
"tachyons": "^4.12.0"
3838
},
3939
"devDependencies": {
4040
"all-contributors-cli": "^6.14.2",
4141
"kcd-scripts": "^6.0.0",
42-
"prettier": "^2.0.5",
4342
"rollup": "^2.12.0",
4443
"webpack": "^4.43.0",
4544
"webpack-cli": "^3.3.11"

pages/elements-panel.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<link rel="stylesheet" href="css/highlight/styles/atom-one-dark.css">
44
<link rel="stylesheet" type="text/css" href="css/tachyons.min.css" />
55
<link rel="stylesheet" type="text/css" href="css/main.css" />
6-
<script src="/dist/elementsPanel.js" ></script>
7-
6+
<script src="/dist/elementsPanel.js" charset="utf-8" ></script>
7+
<meta charset="utf-8">
88
</head>
99

1010
<body class="bg-light-gray">

src/elementsPanel.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Bridge = require("crx-bridge").default;
2-
const beautify = require("js-beautify").js;
2+
const prettier = require("prettier/standalone");
3+
const babelParser = require("prettier/parser-babel");
34
const hljs = require("../lib/highlight.pack");
45
Bridge.onMessage(
56
"show-suggestion",
@@ -21,7 +22,10 @@ Bridge.onMessage(
2122

2223
const codeBlock = document.querySelector("#query-code");
2324

24-
codeBlock.innerText = beautify(`screen.${suggestedQuery}`);
25+
codeBlock.innerText = prettier.format(`screen.${suggestedQuery}`, {
26+
parser: "babel",
27+
plugins: [babelParser],
28+
});
2529

2630
hljs.highlightBlock(codeBlock);
2731
}

0 commit comments

Comments
 (0)