Skip to content

Instantly share code, notes, and snippets.

@sarahcssiqueira
Last active August 14, 2024 18:18
Show Gist options
  • Save sarahcssiqueira/ffc1d67f6213d958593049e8915cb8ff to your computer and use it in GitHub Desktop.
Save sarahcssiqueira/ffc1d67f6213d958593049e8915cb8ff to your computer and use it in GitHub Desktop.
Eslint, Prettier and VS Code settings for a React app project
/node_modules
/build
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
}
},
"plugins": [
"react",
"react-hooks"
],
"rules": {
"indent": ["error", "tab"],
"no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }],
"prettier/prettier": ["error", {}, { "usePrettierrc": true }]
}
}
/node_modules
/build
{
"arrowParens": "always",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": true,
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"useTabs": true,
"printWidth": 140,
"tabWidth": 2,
"rangeStart": 0
}
{
"editor.tabSize": 4,
"editor.detectIndentation": false,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment