Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Add Developer Tools setup in Getting Started #19074

Merged
merged 4 commits into from
Dec 20, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/contributors/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,26 @@ You can launch Storybook by running `npm run storybook:dev` locally. It will ope
You can also test Storybook for the current `master` branch on GitHub Pages: [https://wordpress.github.io/gutenberg/](https://wordpress.github.io/gutenberg/)

[Storybook]: https://storybook.js.org/

## Developer Tools

We recommend configuring your editor to automatically check for syntax and lint errors. This will help you save time as you develop by automatically fixing minor formatting issues. Here are some directions for setting up Visual Studio Code, a popular editor used by many of the core developers.

[EditorConfig](https://editorconfig.org/) defines a standard configuration for setting up your editor, for example uses tabs instead of spaces. You should install the **EditorConfig for VS Code** extension and it will automatically configure your editor to match the rules defined in [.editorconfig](https://github.com/WordPress/gutenberg/blob/master/.editorconfig).

[Prettier](https://prettier.io/) is a tool that allows you to define an opinionated format, and automate fixing the code to match that format. Work is underway to use Prettier within Gutenberg, see [PR #18048](https://github.com/WordPress/gutenberg/pull/18048).

To use Prettier, you should install the **Prettier - Code formatter** extension in Visual Studio Code. You can then configure it to be the default formatter and to automatically fix issues on save, by adding the following to your settings.

```json
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
```

This will use the `.prettierrc` file. To test it out prior to PR #18048 being merged, you should:
mkaz marked this conversation as resolved.
Show resolved Hide resolved

1. git switch add/prettier
2. npm install
mkaz marked this conversation as resolved.
Show resolved Hide resolved
3. Edit a JavaScript file and on save it will format it as defined