Phecda

chore: add prettier & lint-staged

  1 +root = true
  2 +
  3 +[*]
  4 +charset = utf-8
  5 +indent_style = space
  6 +indent_size = 2
  7 +end_of_line = lf
  8 +insert_final_newline = true
  9 +trim_trailing_whitespace = true
1 module.exports = { 1 module.exports = {
2 root: true, 2 root: true,
3 - extends: '@react-native-community', 3 + extends: ['@react-native-community', 'plugin:prettier/recommended'],
4 parser: '@typescript-eslint/parser', 4 parser: '@typescript-eslint/parser',
5 plugins: ['@typescript-eslint'], 5 plugins: ['@typescript-eslint'],
6 }; 6 };
  1 +{
  2 + "useTabs": false,
  3 + "tabWidth": 2,
  4 + "singleQuote": true,
  5 + "trailingComma": "es5"
  6 +}
@@ -29,9 +29,13 @@ @@ -29,9 +29,13 @@
29 "commitizen": "^4.0.3", 29 "commitizen": "^4.0.3",
30 "cz-conventional-changelog": "^3.1.0", 30 "cz-conventional-changelog": "^3.1.0",
31 "eslint": "^6.5.1", 31 "eslint": "^6.5.1",
  32 + "eslint-config-prettier": "^6.10.0",
  33 + "eslint-plugin-prettier": "^3.1.2",
32 "husky": "^4.2.3", 34 "husky": "^4.2.3",
33 "jest": "^24.9.0", 35 "jest": "^24.9.0",
  36 + "lint-staged": ">=10",
34 "metro-react-native-babel-preset": "^0.56.0", 37 "metro-react-native-babel-preset": "^0.56.0",
  38 + "prettier": "1.19.1",
35 "react-test-renderer": "16.9.0", 39 "react-test-renderer": "16.9.0",
36 "standard-version": "^7.1.0", 40 "standard-version": "^7.1.0",
37 "typescript": "^3.7.3" 41 "typescript": "^3.7.3"
@@ -54,7 +58,11 @@ @@ -54,7 +58,11 @@
54 }, 58 },
55 "husky": { 59 "husky": {
56 "hooks": { 60 "hooks": {
  61 + "pre-commit": "lint-staged",
57 "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" 62 "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
58 } 63 }
  64 + },
  65 + "lint-staged": {
  66 + "*.{js,jsx,ts,tsx}": "eslint --fix"
59 } 67 }
60 } 68 }
This diff is collapsed. Click to expand it.