- Mastering React Test:Driven Development
- Daniel Irvine
- 158字
- 2021-06-24 14:44:59
Prettier
I have used Prettier to format code samples, and its configuration is set within package.json in each of the appointments and spec-logo projects. Here it is:
"prettier": {
"singleQuote": true,
"printWidth": 67,
"jsxBracketSameLine": true
}
Feel free to change this to your own configuration and reformat files as you see fit. The line width of 67 characters is particularly short but ensures that, for the most part, code snippets do not suffer from line breaks.
The one place this is not true is with test descriptions:
it('passes from and to times through to appointments when retrieving appointments', async () => {
In these cases, although the text is printed over two lines, you should enter it on one line only. If you are copy and pasting code samples from the electronic version of this book, you’ll need to remove the extra line breaks that are inserted by your editor.
推薦閱讀
- UNIX編程藝術(shù)
- UI設(shè)計(jì)基礎(chǔ)培訓(xùn)教程
- HTML5移動(dòng)Web開發(fā)技術(shù)
- Oracle數(shù)據(jù)庫(kù)從入門到運(yùn)維實(shí)戰(zhàn)
- R的極客理想:工具篇
- SQL Server 2016數(shù)據(jù)庫(kù)應(yīng)用與開發(fā)習(xí)題解答與上機(jī)指導(dǎo)
- Getting Started with NativeScript
- .NET 4.5 Parallel Extensions Cookbook
- Python程序設(shè)計(jì)開發(fā)寶典
- Python計(jì)算機(jī)視覺和自然語(yǔ)言處理
- IoT Projects with Bluetooth Low Energy
- 區(qū)塊鏈架構(gòu)之美:從比特幣、以太坊、超級(jí)賬本看區(qū)塊鏈架構(gòu)設(shè)計(jì)
- R的極客理想:量化投資篇
- TypeScript全棧開發(fā)
- Test-Driven iOS Development with Swift