Skip to content

Commit 25bdaf9

Browse files
feat(prettierOnMarkdown): Added Reference to prettier in Code Editor and created config file
1 parent ef18093 commit 25bdaf9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

browser/components/CodeEditor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {generateInEditor, tocExistsInEditor} from 'browser/lib/markdown-toc-gene
2828
import markdownlint from 'markdownlint'
2929
import Jsonlint from 'jsonlint-mod'
3030
import { DEFAULT_CONFIG } from '../main/lib/ConfigManager'
31+
const prettier = require('prettier')
3132

3233
CodeMirror.modeURL = '../node_modules/codemirror/mode/%N/%N.js'
3334

@@ -232,6 +233,10 @@ export default class CodeEditor extends React.Component {
232233
}
233234
return CodeMirror.Pass
234235
},
236+
'Shift-Alt-F': cm => {
237+
// console.log(prettier.format('foo ( );', { semi: false, parser: 'babel' }))
238+
// console.log('Key Combo Pressed')
239+
},
235240
[translateHotkey(hotkey.pasteSmartly)]: cm => {
236241
this.handlePaste(cm, true)
237242
}

prettier.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 4,
4+
"semi": false,
5+
"singleQuote": true
6+
}

0 commit comments

Comments
 (0)