Skip to content

Instantly share code, notes, and snippets.

@iegik
Last active September 28, 2022 08:15
Show Gist options
  • Save iegik/013d5cd5ed41db27d2892831ae9ed697 to your computer and use it in GitHub Desktop.
Save iegik/013d5cd5ed41db27d2892831ae9ed697 to your computer and use it in GitHub Desktop.
{
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true
}

Code Style

Project configured to use following rule chain:

.editorconfig -> .prettierrc -> .eslint
  • .editorconfig will tell your editor how to handle spaces and newlines
  • .prettierrc will add some newlines, spaces and brackets to make code easier to read
  • .eslintrc will strict code to the rules, to exclude oblivious errors

Recommended VSCode settings plugin:

  "editor.tabSize": 2,
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment