Skip to content

Commit 3fc9d8c

Browse files
committed
Update CONTRIBUTING and package json
1 parent 0895e20 commit 3fc9d8c

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ If you are implementing a new feature, or modifying styles, please replace/add s
88

99
### Prettier
1010

11-
[Prettier](https://github.com/prettier/prettier) is used to keep a consistent code style across the project. Before committing, run `npm run prettier` which will transform your code to fit the projects style.
11+
[Prettier](https://github.com/prettier/prettier) is used to keep a consistent code style across the project. Before committing, run `npm run prettier` which will list all files that aren't formatted correctly, then rin `npm run prettier:write` to transform your code to fit the projects style.
1212

1313
### ESLint
1414

1515
[ESLint](https://github.com/eslint/eslint) is used for code linting inside your IDE/text editor. If you don't have ESLint installed in your editor, you should install it - [https://eslint.org/docs/user-guide/integrations](https://eslint.org/docs/user-guide/integrations).
1616

17-
To find any errors or warnings, either view them in your editor once you've installed the right package, or run `npm run eslint`. Not all errors/warnings can be fixed, and some will be picked up by prettier, so don't worry if you can't fix them.
17+
To find any errors or warnings, either view them in your editor once you've installed the right package, or run `npm run eslint`. Not all errors/warnings can be fixed, and some will be picked up by Prettier, so don't worry if you can't fix them. To automatically fix some errors/warnings, run `npm run eslint:fix`.
18+
19+
### Prettier & ESLint
20+
21+
To autoamtically format and fix linting errors, run `npm run format`. This runs Prettier, then ESLint.
1822

1923
### Lock Files
2024

package-lock.json

Lines changed: 22 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
"start": "react-native run-ios",
77
"start:x": "react-native run-ios --simulator='iPhone X'",
88
"link": "react-native link",
9-
"prettier": "prettier --write \"**/*.js\"",
10-
"eslint": "eslint --fix .; exit 0;",
9+
"prettier": "prettier -l \"**/*.js\"; exit 0;",
10+
"prettier:write": "prettier --write \"**/*.js\"; exit 0;",
11+
"eslint": "eslint .; exit 0;",
12+
"eslint:fix": "eslint --fix .; exit 0;",
1113
"format": "npm run prettier && npm run eslint",
1214
"test": "jest"
1315
},
1416
"dependencies": {
1517
"cheerio-without-node-native": "^0.20.2",
1618
"javascript-time-ago": "^1.0.28",
19+
"prop-types": "^15.6.0",
1720
"react": "16.2.0",
1821
"react-native": "^0.53.0",
1922
"react-native-haptic": "^1.0.5",
@@ -24,6 +27,7 @@
2427
"react-native-tableview": "^2.1.0",
2528
"react-redux": "^5.0.6",
2629
"redux": "^3.7.2",
30+
"redux-logger": "^3.0.6",
2731
"redux-persist": "^5.6.10",
2832
"redux-thunk": "^2.2.0"
2933
},
@@ -33,13 +37,14 @@
3337
"babel-preset-react-native": "4.0.0",
3438
"eslint": "^4.18.1",
3539
"eslint-config-airbnb": "^16.1.0",
40+
"eslint-config-prettier": "^2.9.0",
3641
"eslint-plugin-import": "^2.9.0",
42+
"eslint-plugin-jest": "^21.12.2",
3743
"eslint-plugin-jsx-a11y": "^6.0.3",
3844
"eslint-plugin-react": "^7.7.0",
3945
"jest": "22.1.4",
4046
"prettier": "1.10.2",
41-
"react-test-renderer": "16.2.0",
42-
"redux-logger": "^3.0.6"
47+
"react-test-renderer": "16.2.0"
4348
},
4449
"jest": {
4550
"preset": "react-native",

0 commit comments

Comments
 (0)