Skip to content

Commit 4f84625

Browse files
committed
upate
1 parent 9172dd1 commit 4f84625

File tree

1 file changed

+33
-33
lines changed
  • challenges/ecosystem

1 file changed

+33
-33
lines changed

challenges/ecosystem/02.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,6 @@ npx expo lint
5858

5959
You will have a `.eslintrc.js` file created at the root of your project.
6060

61-
### Prettier
62-
63-
- [ ] Install the following dependencies
64-
65-
```console
66-
npm install --save-dev prettier eslint-config-prettier eslint-plugin-prettier
67-
# or `yarn add --dev prettier eslint-config-prettier eslint-plugin-prettier`
68-
```
69-
70-
- [ ] Update your `eslintrc.js` file to add the following rules:
71-
72-
```javascript
73-
// .eslintrc.js
74-
75-
module.exports = {
76-
extends: ["expo", "prettier"],
77-
plugins: ["prettier"],
78-
rules: {
79-
"prettier/prettier": "warn",
80-
},
81-
};
82-
```
83-
8461
### Run ESLint from the terminal
8562

8663
- [ ] Update your scripts on `package.json` to check errors.
@@ -118,6 +95,29 @@ npm run lint -- --fix
11895
- [ ] Push your project to GitHub to have a backup.
11996
- [ ] if you encounter a difference between errors on your terminal and VSCode, reload VSCode with `⌘ + ⇧ + P` "Developer: Reload Window".
12097

98+
### Prettier
99+
100+
- [ ] Install the following dependencies
101+
102+
```console
103+
npm install --save-dev prettier eslint-config-prettier eslint-plugin-prettier
104+
# or `yarn add --dev prettier eslint-config-prettier eslint-plugin-prettier`
105+
```
106+
107+
- [ ] Update your `eslintrc.js` file to add the following rules:
108+
109+
```javascript
110+
// .eslintrc.js
111+
112+
module.exports = {
113+
extends: ["expo", "prettier"],
114+
plugins: ["prettier"],
115+
rules: {
116+
"prettier/prettier": "warn",
117+
},
118+
};
119+
```
120+
121121
### ESLint and prettier rules for React Native
122122

123123
We are making progress, but we are not done yet. We need to add rules for React Native. In the meantime, let's install some plugins to format our code with prettier and sort imports automatically.
@@ -162,7 +162,7 @@ module.exports = {
162162

163163
- Create a `.prettierrc` file at the root of your project with the following content:
164164

165-
```json
165+
```javascript
166166
// .prettierrc
167167

168168
{
@@ -189,7 +189,7 @@ npm install --dev eslint-plugin-react-native
189189

190190
- [ ] Update your `.eslintrc.js` file to add the following react-native rules:
191191

192-
```json
192+
```javascript
193193
// .eslintrc.js
194194

195195
{
@@ -215,7 +215,7 @@ npm install --dev eslint-plugin-simple-import-sort
215215

216216
- [ ] Update your `.eslintrc.js` file to add the following import rules:
217217

218-
```json
218+
```javascript
219219
// .eslintrc.js
220220

221221
{
@@ -252,7 +252,7 @@ In our case `cargo_capacity`, `cost_in_credits` are not using `camelCase` and we
252252

253253
- [ ] Update your `.eslintrc.js` file to add the following rules:
254254

255-
```json
255+
```javascript
256256
// .eslintrc.js
257257

258258
{
@@ -274,11 +274,11 @@ In our case `cargo_capacity`, `cost_in_credits` are not using `camelCase` and we
274274

275275
### Share your settings with your team
276276

277-
You can share your VSCode settings with your team by adding a `.vscode` folder at the root of your project with the following content:
277+
You can share your VSCode settings with your team by adding a `.vscode` folder at the root of your project with the following content.
278278

279-
```json
280-
// .vscode/settings.json
279+
This will make sure everyone in your team is using the same settings.
281280

281+
```json
282282
{
283283
"editor.formatOnSave": true,
284284
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
@@ -288,6 +288,6 @@ You can share your VSCode settings with your team by adding a `.vscode` folder a
288288
}
289289
```
290290

291-
This will make sure everyone in your team is using the same settings.
292-
293-
- [ ] create a ``.vscode` folder and paste the previous `settings.json` files.
291+
- [ ] create a `.vscode` folder.
292+
- [ ] create a `settings.json` file.
293+
- [ ] Add the content above.

0 commit comments

Comments
 (0)