Fix badly rendered code blocks in JavaScript styleguide
This commit is contained in:
parent
2ad5b30b6c
commit
ec0b681324
1 changed files with 5 additions and 1 deletions
|
@ -95,6 +95,7 @@ See [our current .eslintrc](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/
|
||||||
#### Modules, Imports, and Exports
|
#### Modules, Imports, and Exports
|
||||||
|
|
||||||
1. Use ES module syntax to import modules
|
1. Use ES module syntax to import modules
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// bad
|
// bad
|
||||||
const SomeClass = require('some_class');
|
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.
|
Do not use them anymore and feel free to remove them when refactoring legacy code.
|
||||||
|
|
||||||
1. Avoid adding to the global namespace.
|
1. Avoid adding to the global namespace.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// bad
|
// bad
|
||||||
window.MyClass = class { /* ... */ };
|
window.MyClass = class { /* ... */ };
|
||||||
|
@ -176,7 +178,8 @@ See [our current .eslintrc](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/
|
||||||
export default class MyClass { /* ... */ }
|
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
|
```javascript
|
||||||
// bad
|
// bad
|
||||||
export default class MyClass { /* ... */ }
|
export default class MyClass { /* ... */ }
|
||||||
|
@ -449,6 +452,7 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
|
||||||
#### Props
|
#### Props
|
||||||
|
|
||||||
1. Props should be declared as an object
|
1. Props should be declared as an object
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// bad
|
// bad
|
||||||
props: ['foo']
|
props: ['foo']
|
||||||
|
|
Loading…
Reference in a new issue