Commit Graph

7 Commits

Author SHA1 Message Date
Michel Weststrate
a3500c453b Fix linter / prettier not working when using sonar as VS Code workspace
Summary: Per title

Reviewed By: antonk52

Differential Revision: D33308303

fbshipit-source-id: b4786fe8070b12ae211b68aafdc32814ea53381e
2021-12-24 07:18:11 -08:00
Michel Weststrate
8b2d8498e6 Upgrade to TypeScript 3.9
Summary:
Upgrading to TypeScript 3.9 so that we can use `// ts-expect-error`, that allows us to basically write unit tests for typings.

Fixed the typescript path in `settings.json`, because otherwise VSCode kept picking the built-in version (3.8.3 atm) of ts when opening the `sonar` folder as workspace.

Reviewed By: passy

Differential Revision: D22255818

fbshipit-source-id: ae54aedb237445f32f1797b4290656dbfb0e528f
2020-07-01 09:12:36 -07:00
Michel Weststrate
7b69b96190 Fix code formatting
Summary:
Had some horrible dev experience caused by  VSCode and Jest not agreeing what snapshots should look like, every time saving a test in VSCode, it would break the jest snapshots. After investigating eslint and prettier, turned out VSCode itself was the culprit. Caused by a global user setting, but this makes sure nobody else runs into it :)

Also made sure Jest uses the correct prettier settings (it didn't before).

Reviewed By: passy

Differential Revision: D22114656

fbshipit-source-id: aef6c278a668bce049c96aba95c7a5101ca840ad
2020-06-19 03:54:49 -07:00
Michel Weststrate
5db7820820 Add support for Jest runner
Summary:
This diff adds compatibility with https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest and makes sure the `yarn jest` command works without further arguments by defaulting to the unit test setup.

This makes tests runnable from VSCode, highlights which tests passed, and show errors inline (and coverage as well if desired), and will report failing tests in the problems panel.

{F235815220}

The debugger can be started right from the code pane as well by clicking the tiny 'debug'

{F235815208}

Currently set up the defaults to not start tests after startup, as it can be CPU hogging, so simply run the command CMD+SHIFT+P 'start jest runner' instead.

Reviewed By: passy

Differential Revision: D21325241

fbshipit-source-id: 7b87297a710a18bbac394110dc2006218ccc7d86
2020-04-30 06:32:34 -07:00
Anton Nikolaev
f506d0eb61 Fix auto-format for js files
Summary: Auto-format for js files was broken on my machine. It seems that there is a conflict between eslint and prettier and the latter is trying to format files after eslint using different rules for that. Option to disable prettier formatting for already formatted files fixed this issue for me.

Reviewed By: jknoxville

Differential Revision: D20994053

fbshipit-source-id: 6e90be7f58f2891ce2143bca8c3d76118b9cfba3
2020-04-14 07:20:40 -07:00
Anton Nikolaev
d98bf10646 Force "\n" line endings in VSCode on Windows
Summary:
1) Forced consistend line endings in VSCode on all OSes
2) Copied VSCode settings to both root folder and "desktop" subfolder so both these folders can be opened as VSCode workspace

Reviewed By: passy

Differential Revision: D20724126

fbshipit-source-id: b9e35c6a055457e05cd1c2d6145a58820cc511f8
2020-03-30 01:58:30 -07:00
Anton Nikolaev
74d8da7c4b VSCode settings
Summary:
1) Add VSCode settings to the source control, so users won't need to configure them
2) Copy VSCode settings to both "sonar" and "sonar/desktop" folders so both folders can be opened for development

Reviewed By: passy

Differential Revision: D20594643

fbshipit-source-id: 4331659008e4dbf9dfcc44a3723ab0612a3bd333
2020-03-23 04:29:08 -07:00