Skip to content

Instantly share code, notes, and snippets.

@n1kk
Last active November 6, 2021 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n1kk/8dcaafd020be3980ff3fab156d5656a0 to your computer and use it in GitHub Desktop.
Save n1kk/8dcaafd020be3980ff3fab156d5656a0 to your computer and use it in GitHub Desktop.
My default repo configs
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120
[*.{yml,yaml,md,toml,json,html}]
indent_size = 2
module.exports = {
// makes it easier to digest single argument lambdas
arrowParens: "avoid",
// whitespace inside brackets increases readability
bracketSpacing: true,
// allows auto format to point out potential bugs with iife or ts cast statements
semi: true,
// having trailing comma can decrease the amount of changed lines in git and make diff more readable
// since adding a comma to allow next argument or key/value pair is a meaningless modification of that line
trailingComma: "all",
// allows code to be displayed as is in all envs, some terminal viewers and console logs/printers can have
// tas width set to 8
useTabs: false,
/// rest can be inferred from .editorconfig
// everything in lf, win<->unix conversion only causes issues
endOfLine: "lf",
// modern monitors are bin enough to fit two panes of 120 side by side
printWidth: 120,
// makes nested branching abuse more obvious
tabWidth: 4,
// makes it easier to move data between js <-> json
singleQuote: false,
overrides: [
// markdown and config files don't benefit from larger indentation
{
files: "*.{yml,yaml,md,toml,json,html}",
options: {
tabWidth: 2,
},
},
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment