Skip to content

Commit dfd3a53

Browse files
committed
Add readme
1 parent fdd2287 commit dfd3a53

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# prettier-config-atomic
2+
3+
The Prettier configuration used in atom-ide-community.
4+
5+
This configuration supports all the formats including `typescript`, `javascript`, `json`, `yaml`, and `markdown`.
6+
7+
## Installation
8+
```
9+
npm install --save-dev prettier-config-atomic
10+
```
11+
12+
<details>
13+
<summary>This package also needs `prettier`.</summary>
14+
15+
Either add the following to your `.npmrc` if using `pnpm` to hoist the prettier bundled with the config
16+
```
17+
public-hoist-pattern[]=*
18+
```
19+
20+
Or install `prettier` yourself in your `devDependencies`.
21+
22+
If using `npm`, the prettier dependency is hosted automatically.
23+
24+
</details>
25+
26+
27+
## Usage
28+
Add the following to your `package.json`
29+
```json
30+
"prettier": "prettier-config-atomic",
31+
"scripts": {
32+
"format": "prettier --write .",
33+
"test.format": "prettier . --check",
34+
}
35+
```
36+
and run `npm run format` to format the files. You can also use `npm run test.format` in the CI to test formatting of the project.
37+
38+
To ignore some files from formatting, create a `.prettierignore` file and add the files to the list.
39+
```
40+
node_modules
41+
package.json
42+
package-lock.json
43+
yarn.lock
44+
pnpm-lock.yaml
45+
coverage
46+
```
47+
48+
Also add the built folders like `dist` to the above list.
49+
50+
### Modifying the config
51+
52+
Create a `prettier.config.js` file at the root of the project with the following content:
53+
```js
54+
module.exports = {
55+
...require("prettier-config-atomic"),
56+
57+
// add the modifications here:
58+
59+
// an example:
60+
// semi: true,
61+
};
62+
```

0 commit comments

Comments
 (0)