Skip to content

Instantly share code, notes, and snippets.

@lokesh1729
Last active July 2, 2019 07:03
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 lokesh1729/8fe264e9fd83023af30641bdb17e1cae to your computer and use it in GitHub Desktop.
Save lokesh1729/8fe264e9fd83023af30641bdb17e1cae to your computer and use it in GitHub Desktop.
#prettier #eslint config for #react
# package.json
{
"devDependencies": {
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^5.0.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-react": "^7.14.1",
"husky": "^2.5.0",
"lint-staged": "^8.2.1",
"prettier": "^1.18.2",
"pretty-quick": "^1.11.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx}": [
"pretty-quick — staged",
"eslint"
]
}
}
# eslintrc
{
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": false,
"codeFrame": false
},
"extends": ["airbnb", "prettier"],
"env": {
"browser": true,
"jest": true
},
"rules": {
"max-len": ["error", {"code": 100}],
"prefer-promise-reject-errors": ["off"],
"react/jsx-filename-extension": ["off"],
"react/prop-types": ["warn"],
"no-return-assign": ["off"]
}
}
# prettierrc
{
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
#editorconfig
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 100
trim_trailing_whitespace = true
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
[{Makefile,**.mk}]
# Use tabs for indentation (Makefiles require tabs)
indent_style = tab
[*.scss]
indent_size = 2
indent_style = space
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment