-
Notifications
You must be signed in to change notification settings - Fork 57
Tips for Developers
Daniel Kmak edited this page Nov 20, 2019
·
12 revisions
If you want to fix ESlint errors in Visual Studio Code change User/Workspace settings, by editing settings.json file. Add:
"eslint.validate": [
{
"language":"javascript",
"autoFix":true
},
{
"language":"javascriptreact",
"autoFix":true
},
{
"language":"typescript",
"autoFix":true
},
{
"language":"typescriptreact",
"autoFix":true
}
]
- Go to keyboard bindings settings in VS Code.
- Search for "ESLint: Fix all auto-fixable problems"
- Click on found row,
Keybinding
column and set a desired keyboard shortcut (for example CTRL+SHIFT+I) - Press enter
You need to get WSL instance IP address. Run this command:
bash.exe -c "ip addr | grep -Ee 'inet.*eth0'"
Grab first IP address and then, for example, before running:
TAG=canary ./origin-docker-run.sh
Change BACKEND_URL
in .env file to be using that IP address you just got. For example if command output was:
inet 171.11.151.33/20 brd xxx.xx.xxx.xxx scope global eth0
Then BACKEND_URL
should be:
171.11.151.33:3030
Use breakpoints and take advantage of VS Code debugging experience.
- Open Debug pane
- Open launch.json by clicking settings icon in Debug pane (next to selected configuration)
- Add following configuration:
{
"type": "node",
"name": "Debug Jest Tests",
"request": "launch",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": [
"--runInBand"
],
"cwd": "${workspaceFolder}/packages/origin-ui",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
}
- Place breakpoints in UI code, for example, in tests
- Select newly added configuration in Debug pane and press start