Skip to content
Snippets Groups Projects
Commit 01514016 authored by DCoded's avatar DCoded
Browse files

Minor contributing documentation tweaks

parent 5d267d63
No related branches found
No related tags found
1 merge request!9364Minor contributing documentation tweaks
# Contributing to FC pregmod
# Contributing to FC: Pregmod
First off, thanks for taking the time to contribute!
......@@ -46,21 +46,63 @@ rules from `.eslintrc.json`.
* prefer strict equality/inequality
* etc.
### JSDoc
### Documentation
It's a good idea to provide meaningful JSDoc for new functions and classes where possible. We follow Typescript's JSDoc
type dialect for the most part (and we provide a Typescript configuration and auxiliary type definition files if you'd
like to use it yourself...it's pretty nifty). Don't worry too much about specific type syntax if you can't make TS work
or don't understand it, someone else will probably fix it for you as long as you've made the intent clear in some form
of JSDoc.
It's a good idea to provide meaningful documentation for new functions and classes where possible. We follow
Typescript's [JSDoc](https://jsdoc.app) type dialect for the most part (and we provide a Typescript configuration and
auxiliary type definition files if you'd like to use it yourself...it's pretty nifty). Don't worry too much about
specific type syntax if you can't make TS work or don't understand it, someone else will probably fix it for you as long
as you've made the intent clear in some form of JSDoc.
### Naming conventions
* JS names are camelCase `fooBar`
* initial lowercase for variables and functions `fooBar`
* initial uppercase for classes and namespaces `Foo.Bar`
* all-caps for constants
* CSS classes are kebob-case. `foo-bar`
* JavaScript variable and function names should be `camelCase`.
```js
// bad
let foobar;
let Foobar;
let FooBar;
// good
let fooBar;
```
* JavaScript constants should be `ALLCAPS`.
```js
// bad
const foo = 'foo';
const fooBar = 'fooBar';
// good
const FOO = 'foo';
const FOOBAR = 'fooBar';
```
* JavaScript classes and namespaces should be `PascalCase`.
```js
// bad
class foo {}
class FOO {}
App.foo.bar();
// good
class Foo {}
App.Foo.bar();
```
* CSS classes are `kebob-case`.
```css
/* bad */
.fooBar {}
.FOO-BAR {}
/* good */
.foo-bar {}
```
New code should generally get organized into the `App` namespace. See `js/002-config/fc-init-js.js` for a rough outline.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment