Skip to content

Commit

Permalink
[doc] update documentation for require-jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Mollweide committed Mar 2, 2017
1 parent ee04f0a commit ecb2803
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
42 changes: 42 additions & 0 deletions documentation/es6.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,48 @@ const str = `Hello, ${name}!`;



### [Require jsdoc](http://eslint.org/docs/rules/require-jsdoc)

> do not require jsdoc

✓ Enabled (error)

```javascript

// BAD
/*
class Test {
constructor() {
this.test = '12';
}
}
*/

// GOOD
/**
* @constructor Test
*/
class Test {

/**
* @returns {void}
*/
constructor() {
this.test = '12';
}
}

// OKAY
const testArrow = () => 'testArrow';


```
<br />



### [Require yield](http://eslint.org/docs/rules/require-yield)

> disallow generator functions that do not have yield
Expand Down
18 changes: 18 additions & 0 deletions documentation/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,24 @@ function good() {

&#10003; Enabled (error)

```javascript

// BAD
/*
function test() {
return 'test';
}
*/

// GOOD
/**
* @returns {string} - something
*/
function test() {
return 'test';
}

```
<br />


Expand Down
15 changes: 15 additions & 0 deletions test/es5/rules/style/require-jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@
// DESCRIPTION = do not require jsdoc
// STATUS = 2

/* eslint no-unused-vars: 0*/

// <!START
// BAD
/*
function test() {
return 'test';
}
*/

// GOOD
/**
* @returns {string} - something
*/
function test() {
return 'test';
}
// END!>
document.window.append('', null);
36 changes: 36 additions & 0 deletions test/es6/rules/es6/require-jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

// DESCRIPTION = do not require jsdoc
// STATUS = 2

/* eslint no-unused-vars: 0*/

// <!START
// BAD
/*
class Test {
constructor() {
this.test = '12';
}
}
*/

// GOOD
/**
* @constructor Test
*/
class Test {

/**
* @returns {void}
*/
constructor() {
this.test = '12';
}
}

// OKAY
const testArrow = () => 'testArrow';

// END!>
document.window.append('', null);

0 comments on commit ecb2803

Please sign in to comment.