Skip to content

Instantly share code, notes, and snippets.

@pratikdevdas
Last active December 18, 2023 23:28
Show Gist options
  • Save pratikdevdas/1d43529afa5ad6819ba2634c0c7596dd to your computer and use it in GitHub Desktop.
Save pratikdevdas/1d43529afa5ad6819ba2634c0c7596dd to your computer and use it in GitHub Desktop.
eslint & Prettier 05/04/2022 for React
node_modules
build
.eslintrc.js
.prettierrc.js
.eslintcache
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
node_modules
build
.eslintrc.js
.prettierrc.js
.eslintcache
module.exports = {
semi: false,
singleQuote: true,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment