enhance documentation around contributing to electron (#11887)
* add issues document * add documentation coding style to doc * copyediting * replace `nodejs/node` with `electron/electron` * fix commasplice * fix two most important... s/is/are/ * omit unnecessary words * add pull requests doc * copyediting * add general code style to styleguide * updates to CONTRIBUTING.md * copyediting * mark shell blocks as ```sh * mitigate phrase duplication e.g. 'best practice' * lots of opinionated changes to omit unnecessary words * fix numbering & re-apply changes that I overwrote
This commit is contained in:
parent
31e0bc02ba
commit
533dfc42a8
4 changed files with 397 additions and 62 deletions
|
|
@ -5,6 +5,23 @@ These are the style guidelines for coding in Electron.
|
|||
You can run `npm run lint` to show any style issues detected by `cpplint` and
|
||||
`eslint`.
|
||||
|
||||
## General Code
|
||||
|
||||
* End files with a newline.
|
||||
* Place requires in the following order:
|
||||
* Built in Node Modules (such as `path`)
|
||||
* Built in Electron Modules (such as `ipc`, `app`)
|
||||
* Local Modules (using relative paths)
|
||||
* Place class properties in the following order:
|
||||
* Class methods and properties (methods starting with a `@`)
|
||||
* Instance methods and properties
|
||||
* Avoid platform-dependent code:
|
||||
* Use `path.join()` to concatenate filenames.
|
||||
* Use `os.tmpdir()` rather than `/tmp` when you need to reference the
|
||||
temporary directory.
|
||||
* Using a plain `return` when returning explicitly at the end of a function.
|
||||
* Not `return null`, `return undefined`, `null`, or `undefined`
|
||||
|
||||
## C++ and Python
|
||||
|
||||
For C++ and Python, we follow Chromium's [Coding
|
||||
|
|
@ -21,6 +38,13 @@ document. The document mentions some special types, scoped types (that
|
|||
automatically release their memory when going out of scope), logging mechanisms
|
||||
etc.
|
||||
|
||||
## Documentation
|
||||
|
||||
* Write [remark](https://github.com/remarkjs/remark) markdown style
|
||||
|
||||
You can run `npm run lint-docs` to ensure that your documentation changes are
|
||||
formatted correctly.
|
||||
|
||||
## JavaScript
|
||||
|
||||
* Write [standard](https://npm.im/standard) JavaScript style.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue