Skip to content

Commit 9236db3

Browse files
authored
Update Developer-Setup.md for Vue.JS
1 parent 8d27e9c commit 9236db3

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

docs/Developer-Setup.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The key part is the symlink to `.venv` so that LSP-pyright and other tool can au
4646
- at least each supported and released minor versions (i.e. security + bugfix on https://devguide.python.org/versions/)
4747
- installed with `pyenv install x.y.z`
4848
- all supported and released minor versions are set in `/Users/<username>/.python-version` (i.e. available when looking for a version with python, python3, python3.x, ...)
49+
- When doing some JS, you obviously need a Node.JS as well
4950
- [hatch](https://pypi.org/project/hatch/) installed globally
5051
- [Visual Studio Code](https://github.com/microsoft/vscode) with following extensions (more or less related to Python development)
5152
- Black Formater (Microsoft)
@@ -62,6 +63,8 @@ The key part is the symlink to `.venv` so that LSP-pyright and other tool can au
6263
- Ruff (Astral Software)
6364
- Volar (Vue)
6465
- YAML (Red Hat)
66+
- Prettier (Prettier)
67+
- ESLint (Microsoft)
6568

6669
Hatch is configured with an additional section in `config.toml` (configuration file is located in `~/Library/Application Support/hatch`, see https://hatch.pypa.io/latest/config/hatch/, correct file is shown by `hatch status` in any case).
6770
```
@@ -74,15 +77,35 @@ This additional Hatch config section ensures that all virtual environments (the
7477
On every project, create a local `.vscode/settings.json` to automatically format your code (adjust `typeCheckingMode` depending on your project):
7578
``` json
7679
{
80+
"[python]": {
81+
"editor.defaultFormatter": "ms-python.black-formatter",
82+
"editor.codeActionsOnSave": {
83+
"source.organizeImports": "explicit"
84+
}
85+
},
86+
"python.analysis.typeCheckingMode": "strict",
87+
"eslint.validate": ["javascript", "typescript", "vue"],
88+
"eslint.workingDirectories": [{ "mode": "auto" }],
89+
"editor.rulers": [88],
90+
"editor.codeActionsOnSave": {
91+
"source.fixAll": "always",
92+
"source.formatDocument": "always"
93+
},
94+
"editor.formatOnSave": true,
95+
"editor.defaultFormatter": "esbenp.prettier-vscode"
96+
}
97+
```
98+
99+
For some projects, you might need to add extra configuration to specify where Python modules can be found:
77100

78-
"[python]": {
79-
"editor.defaultFormatter": "ms-python.black-formatter",
80-
"editor.formatOnSave": true,
81-
"editor.codeActionsOnSave": {
82-
"source.organizeImports": true
83-
},
84-
},
85-
"python.analysis.typeCheckingMode": "basic",
101+
```json
102+
{
103+
...
104+
"python.analysis.extraPaths": [
105+
"scraper/src",
106+
"scraper/.hatch/libretexts2zim/lib/python3.12/site-packages"
107+
],
108+
...
86109
}
87110
```
88111

@@ -92,4 +115,4 @@ When starting to work on a project, start a shell on default env + installing de
92115
hatch shell
93116
pip install '.[dev]'
94117
code .
95-
```
118+
```

0 commit comments

Comments
 (0)