You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/learn/editor-setup.md
+17-5Lines changed: 17 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,19 @@ Other popular text editors used in the React community include:
26
26
27
27
Some editors come with these features built in, but others might require adding an extension. Check to see what support your editor of choice provides to be sure!
28
28
29
-
### Linting
29
+
### Python Linting
30
30
31
-
Code linters find problems in your code as you write, helping you fix them early. [ESLint](https://eslint.org/) is a popular, open source linter for JavaScript.
31
+
Linting is the process of running a program that will analyse code for potential errors. [Flake8](https://flake8.pycqa.org/en/latest/) is a popular, open source linter for Python.
32
+
33
+
-[Install Flake8](https://flake8.pycqa.org/en/latest/#installation) (be sure you have [Python installed!](https://www.python.org/downloads/))
34
+
-[Integrate Flake8 in VSCode with the official extension](https://marketplace.visualstudio.com/items?itemName=ms-python.flake8)
35
+
-[Install Reactpy-Flake8](https://pypi.org/project/reactpy-flake8/) to lint your ReactPy code
36
+
37
+
### JavaScript Linting
38
+
39
+
You typically won't use much JavaScript alongside ReactPy, but there are still some cases where you might. For example, you might want to use JavaScript to fetch data from an API or to add some interactivity to your app.
40
+
41
+
In these cases, it's helpful to have a linter that can catch common mistakes in your code as you write it. [ESLint](https://eslint.org/) is a popular, open source linter for JavaScript.
32
42
33
43
-[Install ESLint with the recommended configuration for React](https://www.npmjs.com/package/eslint-config-react-app) (be sure you have [Node installed!](https://nodejs.org/en/download/current/))
34
44
-[Integrate ESLint in VSCode with the official extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
@@ -42,18 +52,20 @@ The last thing you want to do when sharing your code with another contributor is
42
52
You can install the [Prettier extension in VSCode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) by following these steps:
43
53
44
54
1. Launch VS Code
45
-
2. Use Quick Open (press Ctrl/Cmd+P)
55
+
2. Use Quick Open, press ++ctrl+p++
46
56
3. Paste in `ext install esbenp.prettier-vscode`
47
57
4. Press Enter
48
58
49
59
#### Formatting on save
50
60
51
61
Ideally, you should format your code on every save. VS Code has settings for this!
52
62
53
-
1. In VS Code, press `CTRL/CMD + SHIFT + P`.
63
+
1. In VS Code, press ++ctrl+shift+p++
54
64
2. Type "settings"
55
65
3. Hit Enter
56
66
4. In the search bar, type "format on save"
57
67
5. Be sure the "format on save" option is ticked!
58
68
59
-
> If your ESLint preset has formatting rules, they may conflict with Prettier. We recommend disabling all formatting rules in your ESLint preset using [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) so that ESLint is _only_ used for catching logical mistakes. If you want to enforce that files are formatted before a pull request is merged, use [`prettier --check`](https://prettier.io/docs/en/cli.html#--check) for your continuous integration.
69
+
!!! note
70
+
71
+
If your ESLint preset has formatting rules, they may conflict with Prettier. We recommend disabling all formatting rules in your ESLint preset using [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) so that ESLint is _only_ used for catching logical mistakes. If you want to enforce that files are formatted before a pull request is merged, use [`prettier --check`](https://prettier.io/docs/en/cli.html#--check) for your continuous integration.
0 commit comments