Skip to content

Instantly share code, notes, and snippets.

@ChinaShrimp
Forked from iannbing/._reactFormatting
Last active March 9, 2020 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChinaShrimp/4399c45d7bc8e8c9f8601dc37dd81191 to your computer and use it in GitHub Desktop.
Save ChinaShrimp/4399c45d7bc8e8c9f8601dc37dd81191 to your computer and use it in GitHub Desktop.
A gist for initial eslint and prettier setup for React projects
{
"extends": ["eslint:recommended", "plugin:react/recommended", "airbnb"],
"env": {
"es6": true,
"jest": true,
"browser": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": true,
"experimentalObjectRestSpread": true
}
},
"plugins": [
"react",
"prettier"
],
"rules": {
"react/jsx-indent": [1, 2],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
}
}
{
"parser": "babel",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": false,
"requirePragma": true,
"insertPragma": true,
"printWidth": 80
}
{
"devDependencies": {
"eslint": "^4.17.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.6.1",
"prettier": "^1.19.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment