Last active
December 18, 2023 23:28
-
-
Save pratikdevdas/1d43529afa5ad6819ba2634c0c7596dd to your computer and use it in GitHub Desktop.
eslint & Prettier 05/04/2022 for React
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
node_modules | |
build | |
.eslintrc.js | |
.prettierrc.js | |
.eslintcache |
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
module.exports = { | |
"env": { | |
"browser": true, | |
"es2021": true | |
}, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:react/recommended", | |
"prettier" | |
], | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true | |
}, | |
"ecmaVersion": "latest", | |
"sourceType": "module" | |
}, | |
"plugins": [ | |
"react" | |
], | |
"rules": { | |
"indent": [ | |
"error", | |
2 | |
], | |
"quotes": [ | |
"error", | |
"single" | |
], | |
"semi": [ | |
"error", | |
"never" | |
], | |
"eqeqeq": "error", | |
"no-trailing-spaces": "error", | |
"object-curly-spacing": [ | |
"error", "always" | |
], | |
"arrow-spacing": [ | |
"error", { "before": true, "after": true } | |
], | |
"no-multiple-empty-lines": 1, | |
"no-console": 0, | |
"react/prop-types": 0, | |
"react/react-in-jsx-scope": "off" | |
}, | |
"settings": { | |
"react": { | |
"version": "detect" | |
} | |
} | |
} | |
/* add following scripts | |
"lint": "eslint .", | |
"lint:fix" : "npm run lint -- --fix" | |
*/ | |
// install and run prettier it wont work either |
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
node_modules | |
build | |
.eslintrc.js | |
.prettierrc.js | |
.eslintcache |
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
module.exports = { | |
semi: false, | |
singleQuote: true, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment