Skip to content

Instantly share code, notes, and snippets.

@abhishekbhardwaj
Created September 21, 2018 06:12
Show Gist options
  • Save abhishekbhardwaj/53e8626b09132f390c752984130ee4cf to your computer and use it in GitHub Desktop.
Save abhishekbhardwaj/53e8626b09132f390c752984130ee4cf to your computer and use it in GitHub Desktop.
Setup ESLint + Prettier in CRA Apps
{
"extends": [
"react-app",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended"
],
"plugins": ["jsx-a11y", "prettier"],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true
}
],
"quotes": [2, "single"]
}
}
"dependencies": {
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-scripts": "1.1.5"
},
"lint-staged": {
"src/**/*.{js,jsx,json,css}": [
"prettier --single-quote --write",
"git add"
]
},
"scripts": {
"lint": "prettier --single-quote --write \"src/**/*.{js,jsx,json,css}\"",
"precommit": "lint-staged",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-prettier": "^2.6.2",
"husky": "^0.14.3",
"lint-staged": "^7.3.0",
"prettier": "^1.14.3"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment