Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pregmodfan
fc-pregmod
Commits
f86d4ca7
Commit
f86d4ca7
authored
3 years ago
by
DCoded
Browse files
Options
Downloads
Patches
Plain Diff
Updated documentation to specifiy enums
parent
a3a556a4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!9364
Minor contributing documentation tweaks
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CONTRIBUTING.md
+35
-5
35 additions, 5 deletions
CONTRIBUTING.md
js/003-data/constants.js
+1
-0
1 addition, 0 deletions
js/003-data/constants.js
with
36 additions
and
5 deletions
CONTRIBUTING.md
+
35
−
5
View file @
f86d4ca7
...
...
@@ -68,16 +68,46 @@ let FooBar;
let
fooBar
;
```
*
JavaScript constants should be
`ALLCAPS`
.
*
Enum members should be
`ALLCAPS`
.
```
ts
// bad
enum
Foo
{
bar
=
'
bar
'
,
Baz
=
'
baz
'
,
}
// good
enum
Foo
{
BAR
=
'
bar
'
,
BAZ
=
'
baz
'
,
}
```
This also applies to JavaScript objects that are used as enums.
```
js
// bad
const
foo
=
'
foo
'
;
const
fooBar
=
'
fooBar
'
;
/** @enum {string} */
const
foo
=
{
bar
:
'
bar
'
,
Baz
:
'
baz
'
,
}
// good
const
FOO
=
'
foo
'
;
const
FOOBAR
=
'
fooBar
'
;
/** @enum {string} */
const
foo
=
{
BAR
:
'
bar
'
,
BAZ
:
'
baz
'
,
}
// better
/** @enum {string} */
const
Foo
=
{
BAR
:
'
bar
'
,
BAZ
:
'
baz
'
,
}
```
*
JavaScript classes and namespaces should be
`PascalCase`
.
...
...
This diff is collapsed.
Click to expand it.
js/003-data/constants.js
+
1
−
0
View file @
f86d4ca7
...
...
@@ -68,6 +68,7 @@ globalThis.Job = Object.freeze({
TANK
:
'
@lay in tank
'
});
/**
* @enum {string}
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment