Skip to content

Instantly share code, notes, and snippets.

@deliseev
Created April 23, 2019 11:54
Show Gist options
  • Save deliseev/abbf4930640e983a13bc58c157e38508 to your computer and use it in GitHub Desktop.
Save deliseev/abbf4930640e983a13bc58c157e38508 to your computer and use it in GitHub Desktop.
create-react-app
yarn create react-app ...
yarn add -D eslint-config-prettier eslint-plugin-prettier husky lint-staged prettier pretty-quick
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/src",
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
}
]
}
"eslintConfig": {
"extends": [
"react-app",
"plugin:prettier/recommended"
],
"rules": {
"jsx-quotes": [
"error",
"prefer-double"
]
}
},
"prettier": {
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"jsxSingleQuote": false
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
"pretty-quick --staged",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
{
"editor.formatOnSave": true,
"html.format.endWithNewline": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment