Last active
December 8, 2023 20:32
-
-
Save devinrhode2/08c84e175c61b282b76f4766a94e4a01 to your computer and use it in GitHub Desktop.
Revisions
-
devinrhode2 revised this gist
Nov 22, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ module.exports = { printWidth: 40, // Less code per line: // - less likely to have conflict any given line // - easier to spot changes in git (e.g. getListThing->getListsThing) // - Encourages modularity // - jsx components with 20 indent levels will not look good // - This encourages creating smaller components -
devinrhode2 revised this gist
Nov 22, 2021 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,12 @@ module.exports = { // 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 trailingComma: 'all', printWidth: 40, // Less code per line: // - less likely to have conflict any given line // - easier to spot changes in git // - Encourages modularity // - jsx components with 20 indent levels will not look good // - This encourages creating smaller components // - Still can opt-out with `// prettier-ignore` comments above component // - OR, create a `.prettierrc.js` file in code you edit the most } -
devinrhode2 revised this gist
Nov 22, 2021 . 1 changed file with 0 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,16 +14,4 @@ module.exports = { // - However, with a low printWidth, code becomes very vertical // - Of course, still aasier to spot single character change with VSCode's help, but // - Since there's less characters overall, there's less code to look through on any given line } -
devinrhode2 revised this gist
Nov 22, 2021 . 1 changed file with 9 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,32 +5,25 @@ module.exports = { singleQuote: true, semi: false, // 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 trailingComma: 'all', printWidth: 40, // Makes inline-diff highlighting less relelvant. // - In VSCode, if you edit the last character in a line, it may be hard to see the actual change. // - Or if there's a one-letter typo... VSCode will highlight that one character change // - However, with a low printWidth, code becomes very vertical // - Of course, still aasier to spot single character change with VSCode's help, but // - Since there's less characters overall, there's less code to look through on any given line // Cannot be "consistent" - would cause thrashing in git history: // quoteProps: "as-needed", // Could go with "preserve" if it makes more sense in some situation // Avoid thrashing, assert default? // arrowParens: "always", // avoid/minimize merge conflicts: // bracketSameLine: false, // avoid XO default `false` https://github.com/xojs/xo/pull/616/files // bracketSpacing: true, } -
devinrhode2 revised this gist
Nov 22, 2021 . 1 changed file with 4 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,8 @@ /** @type {import('prettier').RequiredOptions} */ module.exports = { singleQuote: true, semi: false, printWidth: 40, // determined here: @@ -21,13 +20,11 @@ module.exports = { // - Of course, still aasier to spot single character change with VSCode's help, but // - Since there's less characters overall, there's less code to look through on any given line // avoid merge conflicts: trailingComma: 'all', bracketSameLine: false, jsxBracketSameLine: false, // deprecated in 2.4 // Cannot be "consistent" - would cause thrashing in git history: quoteProps: "as-needed", // Could go with "preserve" if it makes more sense in some situation -
devinrhode2 revised this gist
Nov 21, 2021 . 2 changed files with 56 additions and 52 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,55 +1,39 @@ // Prettier config to reduce merge conflicts: https://gist.github.com/devinrhode2/08c84e175c61b282b76f4766a94e4a01 /** @type {import('prettier').RequiredOptions} */ module.exports = { // Devins personal preferences: singleQuote: true, // Also avoids extra finger movement: semi: false, // less visual clutter printWidth: 40, // determined here: // commit 27987c4b47834a1fff9402b729d3a39d7539b6f9 // Author: Rhode, Devin <[email protected]> // Date: Wed Oct 27 16:29:49 2021 -0500 // // wip redirect manager // // It also makes inline-diff highlighting less relelvant. // - In VSCode, if you edit the last character in a line, it may be hard to see the actual change. // - Or if there's a one-letter typo... VSCode will highlight that one character change // - However, with a low printWidth, code becomes very vertical // - Of course, still aasier to spot single character change with VSCode's help, but // - Since there's less characters overall, there's less code to look through on any given line // Required: bracketSameLine: false, jsxBracketSameLine: false, // deprecated in 2.4 // Required: trailingComma: 'all', // Cannot be "consistent" - would cause thrashing in git history: quoteProps: "as-needed", // Could go with "preserve" if it makes more sense in some situation // Avoid thrashing, assert default? arrowParens: "always", // avoid XO default `false` https://github.com/xojs/xo/pull/616/files bracketSpacing: true, } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ These prettier config settings are intended to reduce merge conflicts as much as possible. My original google searches: what prettier options are best for git diffs what prettier options are best for git diffs avoid merge conflicts what prettier options are best for git diffs avoid merge conflicts "trailingComma" prettier lowest printWidth Something I would like, is an eslint config that is _very similar_ to prettier, but does has less deterministic formatting - I sense starting with Standard.js or XO eslint style config would be a good starting point. I'm curious what doing a format with printWidth: 1, and then doing a normal format would be like. Sometimes prettier will make things more vertical, but not make them more horizontal. Obviously more vertical is best for reducing merge conflicts. -
devinrhode2 renamed this gist
Nov 21, 2021 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ /* These prettier config settings are intended to reduce merge conflicts as much as possible. My original google searches: what prettier options are best for git diffs @@ -12,9 +13,8 @@ Something I would like, is an eslint config that is _very similar_ to prettier, I'm curious what doing a format with printWidth: 1, and then doing a normal format would be like. Sometimes prettier will make things more vertical, but not make them more horizontal. Obviously more vertical is best for reducing merge conflicts. */ /** @type {import('prettier').RequiredOptions} */ module.exports = { printWidth: 40, @@ -52,5 +52,4 @@ arrowParens: "always" // avoid XO default `false` https://github.com/xojs/xo/pull/616/files bracketSpacing: true, } -
devinrhode2 revised this gist
Nov 21, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Sometimes prettier will make things more vertical, but not make them more horizo Obviously more vertical is best for reducing merge conflicts. ```ts /** @type {import('prettier').RequiredOptions} */ module.exports = { printWidth: 40, -
devinrhode2 created this gist
Nov 21, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ # These prettier config settings are intended to reduce merge conflicts as much as possible. My original google searches: what prettier options are best for git diffs what prettier options are best for git diffs avoid merge conflicts what prettier options are best for git diffs avoid merge conflicts "trailingComma" prettier lowest printWidth Something I would like, is an eslint config that is _very similar_ to prettier, but does has less deterministic formatting - I sense starting with Standard.js or XO eslint style config would be a good starting point. I'm curious what doing a format with printWidth: 1, and then doing a normal format would be like. Sometimes prettier will make things more vertical, but not make them more horizontal. Obviously more vertical is best for reducing merge conflicts. ```js /** @type {import('prettier').RequiredOptions} */ module.exports = { printWidth: 40, // determined here: // commit 27987c4b47834a1fff9402b729d3a39d7539b6f9 (origin/chore-dgr-dropping-xo-fix-all-script, chore-dgr-dropping-xo-fix-all-script) // Author: Rhode, Devin <[email protected]> // Date: Wed Oct 27 16:29:49 2021 -0500 // // wip redirect manager // // It also makes inline-diff highlighting less relelvant. // - In VSCode, if you edit the last character in a line, it may be hard to see the actual change. // - Or if there's a one-letter typo... VSCode will highlight that one character change // - However, with a low printWidth, code becomes very vertical // - Of course, still aasier to spot single character change with VSCode's help, but // - Since there's less characters overall, there's less code to look through on any given line // Required: bracketSameLine: false, jsxBracketSameLine: false // deprecated in 2.4 // Required: trailingComma: 'all' // Cannot be "consistent" - would cause thrashing in git history: quoteProps: "as-needed" // Could go with "preserve" if it makes more sense in some situation // Devins personal preference: // Also avoids extra finger movement: singleQuote: true // Avoid thrashing, assert default? arrowParens: "always" // avoid XO default `false` https://github.com/xojs/xo/pull/616/files bracketSpacing: true, } ```