Skip to content

Instantly share code, notes, and snippets.

@tarikulwebx
Last active July 17, 2024 01:34
Show Gist options
  • Save tarikulwebx/d38253a193611d95dfba3b66500d7fa9 to your computer and use it in GitHub Desktop.
Save tarikulwebx/d38253a193611d95dfba3b66500d7fa9 to your computer and use it in GitHub Desktop.
Required Prettier Configuration for React App
module.exports = {
printWidth: 120, // max 120 chars in line, code is easy to read
useTabs: false, // use spaces instead of tabs
tabWidth: 4, // "visual width" of of the "tab"
trailingComma: 'es5', // add trailing commas in objects, arrays, etc.
semi: true, // add ; when needed
singleQuote: true, // '' for stings instead of ""
bracketSpacing: true, // import { some } ... instead of import {some} ...
arrowParens: 'always', // braces even for single param in arrow functions (a) => { }
jsxSingleQuote: false, // "" for react props, like in html
bracketSameLine: false, // pretty JSX
endOfLine: 'lf', // 'lf' for linux, 'crlf' for windows, we need to use 'lf' for git
};
@tarikulwebx
Copy link
Author

Attach to your project root ->
Prettier-config

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