From 0151401619fd287dff66c77e7e1dbbb2d1af9c55 Mon Sep 17 00:00:00 2001 From: DCoded <dicoded@email.com> Date: Wed, 28 Apr 2021 12:53:38 -0400 Subject: [PATCH] Minor contributing documentation tweaks --- CONTRIBUTING.md | 66 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e09b5b4c5a..a500dd4beb1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# 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. -- GitLab