Created
September 21, 2018 06:12
-
-
Save abhishekbhardwaj/53e8626b09132f390c752984130ee4cf to your computer and use it in GitHub Desktop.
Setup ESLint + Prettier in CRA Apps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": [ | |
"react-app", | |
"plugin:jsx-a11y/recommended", | |
"plugin:prettier/recommended" | |
], | |
"plugins": ["jsx-a11y", "prettier"], | |
"rules": { | |
"prettier/prettier": [ | |
"error", | |
{ | |
"singleQuote": true | |
} | |
], | |
"quotes": [2, "single"] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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