Skip to content
Merged
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,14 @@ VSCode | [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeum
IntelliJ | Settings » Languages & Frameworks » JavaScript » Code Quality Tools » ESLint
`vi` | [scrooloose/syntastic](https://github.com/scrooloose/syntastic)

#### Tools for Consistent Coding Style

Another tool we use for enforcing consistent coding style is EditorConfig, which can be set up by installing a plugin in your editor that dynamically updates its configuration. Take a look at the [EditorConfig](http://editorconfig.org/#download) site to find a plugin for your editor, and browse our [`.editorconfig`](https://github.com/elastic/kibana/blob/master/.editorconfig) file to see what config rules we set up.

Currently, we're migrating our codebase over to [Prettier](https://prettier.io/). Prettier is an opinionated code formatter that integrates with most editors. Prettier formats code when you save a file so that we spend less time discussing coding style and focus more on features and bugs. You can learn how to set up Prettier on your favorite editor by visiting [Prettier](https://prettier.io/) website. Our prettier rules can be found in [`.prettierrc`](https://github.com/elastic/kibana/blob/master/.prettierrc) file.
Comment thread
spalger marked this conversation as resolved.
Outdated

#### Setup Guide for VS Code Users

Note that for VSCode, to enable "live" linting of TypeScript (and other) file types, you will need to modify your local settings, as shown below. The default for the ESLint extension is to only lint JavaScript file types.

```json
Expand All @@ -317,6 +323,19 @@ Note that for VSCode, to enable "live" linting of TypeScript (and other) file ty
]
```

To make `prettier` automatically format your code on save, open add those lines below:

```json
Comment thread
spalger marked this conversation as resolved.
Outdated
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
```

`eslint` can fix trivial lint errors. And `eslint` plugin can do that for you when you save a file by adding this line in your setting.
Comment thread
sainthkh marked this conversation as resolved.
Outdated

```json
"eslint.autoFixOnSave": true,
```

### Internationalization

All user-facing labels and info texts in Kibana should be internationalized. Please take a look at the [readme](packages/kbn-i18n/README.md) and the [guideline](packages/kbn-i18n/GUIDELINE.md) of the i18n package on how to do so.
Expand Down