Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f0b90e5

Browse files
Sync .prettierrc.js
what I'm using in tsc-with-snapshotting
1 parent 8d6db9c commit f0b90e5

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

‎.prettierrc.js‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
// Type-check prettier config:
2-
/** @type {import("prettier").Config} */
1+
// Prettier config to reduce merge conflicts: https://gist.github.com/devinrhode2/08c84e175c61b282b76f4766a94e4a01
2+
3+
/** @type {import('prettier').Options} */
34
const conf = {
4-
semi: false,
55
singleQuote: true,
6-
printWidth: 40,
7-
8-
// TODO: explicitly specify all prettier config options here
9-
// This means no matter how prettier runs on this project,
10-
// the settings will be correct.
6+
semi: false,
117

12-
// Avoid even more merge conflicts: https://prettier.io/blog/2020/03/21/2.0.0.html#change-default-value-for-trailingcomma-to-es5-6963httpsgithubcomprettierprettierpull6963-by-fiskerhttpsgithubcomfisker
8+
// avoid even more merge conflicts: https://prettier.io/blog/2020/03/21/2.0.0.html#change-default-value-for-trailingcomma-to-es5-6963httpsgithubcomprettierprettierpull6963-by-fiskerhttpsgithubcomfisker
139
trailingComma: 'all',
10+
printWidth: 40,
11+
// Less code per line means:
12+
// - less likely to have conflict on any given line
13+
// - easier to spot changes in git (e.g. getListThing->getListsThing)
14+
// - Encourages modularity
15+
// - jsx components with 20 indent levels will not look good
16+
// - This encourages creating smaller components
17+
// - Still can opt-out with `// prettier-ignore` comments above component
18+
// - OR, create a `.prettierrc.js` file in code you edit the most
19+
// - This exact number will always be somewhat arbitrary, it's not set in stone.
1420
}
1521

1622
module.exports = conf

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /