|
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} */ |
3 | 4 | const conf = { |
4 | | - semi: false, |
5 | 5 | 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, |
11 | 7 |
|
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 |
13 | 9 | 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. |
14 | 20 | } |
15 | 21 |
|
16 | 22 | module.exports = conf |
0 commit comments