This repository was archived by the owner on Feb 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 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 ">
Original file line number Diff line number Diff line change 11const 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" ) ;
34const hljs = require ( "../lib/highlight.pack" ) ;
45Bridge . 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 }
You can’t perform that action at this time.
0 commit comments