4.0.0 • Published 3 years ago
@sixfold/editor-config v4.0.0
editor-config
How to use Prettier
- Install the config and prettier:
yarn add @sixfold/editor-config prettier -D- Add the following line in the target service's package.json:
"prettier": "@sixfold/editor-config/prettier"- Add the following scripts to your package.json
"prettier": "prettier \"./src/**/**\"",
"prettier:check": "yarn prettier --check",
"prettier:fix": "yarn prettier --write",- Add a
.prettierignorefile at the source of the repository, containing at least the following:
package.json
.DS_StoreMake sure to include .prettierignore in your docker (test) if you check prettier formatting as part of the tests.
- Configure your IDE to use
Prettier:
- Add
yarn prettier:checkas part of thetestorbuildscript to ensure that code is consistently formatted
Using prettier config with prettier APIs
When generating code programmatically, same configuration can be used to format generated output:
import * as prettier from 'prettier';
import * as prettierConfig from '@sixfold/editor-config';
const source = 'function main(){console.log("Hello")};main()';
console.log(prettier.format(source, prettierConfig));4.0.0
3 years ago
3.0.0
3 years ago
3.0.0-next.0
3 years ago
2.3.0
4 years ago
2.2.2
4 years ago
2.2.1
4 years ago
2.2.0
4 years ago
2.1.1
5 years ago
2.1.0
5 years ago
2.0.4
5 years ago
2.0.3
5 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.4.2
6 years ago
1.4.1
6 years ago
1.4.0
6 years ago
1.3.0
6 years ago
1.2.0
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.0
6 years ago