1.0.10 • Published 6 years ago
eslint-config-iamdevlinph v1.0.10
ESLint and Prettier Configuration
ESLint and Prettier Configuration I use on VS Code. Inspired by wesbos'
Works on:
- React
- styled-components in react
Installation
Make sure your project already has a
package.json, if not create one usingnpm init.Install dependencies needed by the config.
npx install-peerdeps --dev eslint-config-iamdevlinphNote: If you're using yarn, npx will ask if you want to use it for the installation. At least on npm -v 6.4.1.
Some dependencies will be added to your
devDependencies.Create a
.eslintrcfile in the root of your project.
{
"extends": [
"iamdevlinph"
]
}Or .eslintrc.js
module.exports = {
"extends": [
"iamdevlinph"
],
};- Customize the configuration.
{
"extends": [
"iamdevlinph
],
"rules": {
"react/jsx-filename-extension": 0,
"import/prefer-default-export": 0
},
"globals": {
"firebase": true,
"window": true
},
}- Add some scripts to your
package.json.
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}- Create a
.eslintignorebeside.eslintrcand ignore the usual folders
**/node_modules/*Using with VS Code
Install ESLint extension
Press
Ctrl + ,to open yoursettings.jsonthen click on the{}on the upper right corner to enter the.jsonformat.

And copy the settings below:
"editor.formatOnSave": true,
"eslint.autoFixOnSave": true,
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
},