summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcia Ramos <marcia@gitlab.com>2019-06-03 16:01:39 +0000
committerMarcia Ramos <marcia@gitlab.com>2019-06-03 16:01:39 +0000
commita41585628990eb48b81ca7a9cf79a51a070ddb24 (patch)
tree9e9a482e4ae276bb2b65842a4767f920374a6faa
parent8e4f121d278899f68fa1505cc0518256f5decd1e (diff)
parentec0b6813249f36e2194069a4c3365de51423053b (diff)
downloadgitlab-ce-a41585628990eb48b81ca7a9cf79a51a070ddb24.tar.gz
Merge branch 'patch-64' into 'master'
Docs: Fix badly rendered code blocks in JavaScript styleguide See merge request gitlab-org/gitlab-ce!29017
-rw-r--r--doc/development/fe_guide/style_guide_js.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/development/fe_guide/style_guide_js.md b/doc/development/fe_guide/style_guide_js.md
index 94dfdbdd073..b50159c2b75 100644
--- a/doc/development/fe_guide/style_guide_js.md
+++ b/doc/development/fe_guide/style_guide_js.md
@@ -95,6 +95,7 @@ See [our current .eslintrc](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/
#### Modules, Imports, and Exports
1. Use ES module syntax to import modules
+
```javascript
// bad
const SomeClass = require('some_class');
@@ -168,6 +169,7 @@ See [our current .eslintrc](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/
Do not use them anymore and feel free to remove them when refactoring legacy code.
1. Avoid adding to the global namespace.
+
```javascript
// bad
window.MyClass = class { /* ... */ };
@@ -176,7 +178,8 @@ See [our current .eslintrc](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/
export default class MyClass { /* ... */ }
```
-1. Side effects are forbidden in any script which contains exports
+1. Side effects are forbidden in any script which contains export
+
```javascript
// bad
export default class MyClass { /* ... */ }
@@ -449,6 +452,7 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
#### Props
1. Props should be declared as an object
+
```javascript
// bad
props: ['foo']