Skip to content

Commit d91140d

Browse files
Alexej Yaroshevichqfox
authored andcommitted
Docs: fix grammar for couple of rules
Fixes #158 Closes gh-161
1 parent 6c74293 commit d91140d

File tree

2 files changed

+37
-29
lines changed

2 files changed

+37
-29
lines changed

README.md

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ To use plugin you should add these lines to configuration file `.jscsrc`:
7373

7474
### checkAnnotations
7575

76-
Ensures tag names are valid
76+
Checks tag names are valid.
7777

7878
There are 3 presets for `Closure Compiler`, `JSDoc3` and `JSDuck5`.
7979

80-
By default it allows any tag of mixed set. You can pass `Object` to select preset with `preset` field and add custom tags with `extra` field.
80+
By default it allows any tag from any preset. You can pass `Object`
81+
to select preset with `preset` field and add custom tags with `extra` field.
8182

82-
Type: `Boolean` or `String` or `{"preset": String, "extra": Object}` (see [tag values](#user-content-tag-values))
83+
Type: `Boolean` or `String` or `{"preset": String, "extra": Object}`
84+
(see [tag values](#user-content-tag-values)).
8385

8486
Values: `true`, `"closurecompiler"`, `"jsdoc3"`, `"jsduck5"`, `Object`
8587

@@ -152,7 +154,7 @@ function _f() {}
152154

153155
### checkParamExistence
154156

155-
Ensures all parameters are documented.
157+
Checks all parameters are documented.
156158

157159
Type: `Boolean`
158160

@@ -197,7 +199,7 @@ function _f ( message ) {
197199

198200
### checkParamNames
199201

200-
Ensures param names in jsdoc and in function declaration are equal
202+
Checks param names in jsdoc and in function declaration are equal.
201203

202204
Type: `Boolean`
203205

@@ -235,7 +237,7 @@ function method(message) {}
235237

236238
### requireParamTypes
237239

238-
Ensures params in jsdoc contains type
240+
Checks params in jsdoc contains type.
239241

240242
Type: `Boolean`
241243

@@ -271,7 +273,7 @@ function method() {}
271273

272274
### checkRedundantParams
273275

274-
Reports redundant params in jsdoc
276+
Reports redundant params in jsdoc.
275277

276278
Type: `Boolean`
277279

@@ -307,7 +309,7 @@ function method() {}
307309

308310
### checkReturnTypes
309311

310-
Reports discrepancies between the claimed in jsdoc and actual type if both exist (code scan)
312+
Checks for differences between the jsdoc and actual return types if both exist.
311313

312314
Type: `Boolean`
313315

@@ -350,7 +352,7 @@ function method(f) {
350352

351353
### checkRedundantReturns
352354

353-
Report statements for functions with no return
355+
Report statements for functions without return.
354356

355357
Type: `Boolean`
356358

@@ -390,7 +392,7 @@ function f() {
390392

391393
### requireReturnTypes
392394

393-
Ensures returns in jsdoc contains type
395+
Checks returns in jsdoc contains type
394396

395397
Type: `Boolean`
396398

@@ -431,11 +433,13 @@ function method() {}
431433

432434
### checkTypes
433435

434-
Reports invalid types for bunch of tags
436+
Reports invalid types for bunch of tags.
435437

436-
In `strictNativeCase` mode ensures that case of natives is the same as in this list: `boolean`, `number`, `string`, `Object`, `Array`, `Date`, `RegExp`.
438+
The `strictNativeCase` mode checks that case of natives is the same as in this
439+
list: `boolean`, `number`, `string`, `Object`, `Array`, `Date`, `RegExp`.
437440

438-
In `capitalizedNativeCase` mode ensures that first letter in all native types and primitives is uppercased except the case with `function` in google closure format: `{function(...)}`
441+
The `capitalizedNativeCase` mode checks that the first letter in all native
442+
types and primitives is uppercased except the case with `function` in google closure format: `{function(...)}`
439443

440444
Type: `Boolean` or `String`
441445

@@ -503,7 +507,7 @@ var x = 1;
503507

504508
### checkRedundantAccess
505509

506-
Reports redundant access declarations
510+
Reports redundant access declarations.
507511

508512
Type: `Boolean` or `String`
509513

@@ -555,9 +559,11 @@ function _f() {}
555559

556560
### leadingUnderscoreAccess
557561

558-
Ensures access declaration is set for `_underscored` function names
562+
Checks access declaration is set for `_underscored` function names
559563

560-
Ignores a bunch of popular identifiers: `__filename`, `__dirname`, `__proto__`, `__defineGetter__`, `super_`, `__constructor`, etc.
564+
Ignores a bunch of popular identifiers:
565+
`__filename`, `__dirname`, `__proto__`, `__defineGetter__`, `super_`,
566+
`__constructor`, etc.
561567

562568
Type: `Boolean` or `String`
563569

@@ -595,7 +601,7 @@ function _e() {}
595601

596602
### enforceExistence
597603

598-
Ensures jsdoc block exist
604+
Checks jsdoc block exists.
599605

600606
Type: `Boolean`, `String` or `Object`
601607

@@ -606,7 +612,8 @@ Values:
606612
- `"allExcept"` array of exceptions:
607613
- `"expressions"` skip expression functions
608614
- `"exports"` skip `module.exports = function () {};`
609-
- `"paramless-procedures"` functions without parameters and with empty return statements will be skipped
615+
- `"paramless-procedures"` functions without parameters and with empty
616+
return statements will be skipped
610617

611618
Context: `functions`
612619

@@ -634,7 +641,7 @@ function _g() {}
634641

635642
### requireHyphenBeforeDescription
636643

637-
Ensures a param description has a hyphen before it (checks for `- `)
644+
Checks a param description has a hyphen before it (checks for `- `).
638645

639646
Type: `Boolean`
640647

@@ -671,7 +678,7 @@ function method() {}
671678

672679
### requireNewlineAfterDescription
673680

674-
Ensures a doc comment description has padding newline
681+
Checks a doc comment description has padding newline.
675682

676683
Type: `Boolean`
677684

@@ -721,7 +728,7 @@ function method() {}
721728

722729
### disallowNewlineAfterDescription
723730

724-
Ensures a doc comment description has no padding newlines
731+
Checks a doc comment description has no padding newlines.
725732

726733
Type: `Boolean`
727734

@@ -771,9 +778,10 @@ function method() {}
771778

772779
### requireDescriptionCompleteSentence
773780

774-
Ensures a doc comment description is a complete sentence.
781+
Checks a doc comment description is a complete sentence.
775782

776-
A complete sentence is defined as starting with an upper case letter and ending with a period.
783+
A complete sentence is defined as starting with an upper case letter and ending
784+
with a period.
777785

778786
Type: `Boolean`
779787

@@ -854,7 +862,7 @@ function method() {}
854862

855863
### requireParamDescription
856864

857-
Ensures a param description exists.
865+
Checks a param description exists.
858866

859867
Type: `Boolean`
860868

@@ -901,7 +909,7 @@ function method(arg) {}
901909

902910
### requireReturnDescription
903911

904-
Ensures a return description exists.
912+
Checks a return description exists.
905913

906914
Type: `Boolean`
907915

lib/rules/validate-jsdoc/require-description-complete-sentence.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports.options = {
55
};
66

77
/**
8-
* Ensures that every sentence starts with an upper case letter.
8+
* Checks that every sentence starts with an upper case letter.
99
*
1010
* This matches when a new line or start of a blank line
1111
* does not start with an upper case letter.
@@ -18,7 +18,7 @@ var START_DESCRIPTION = /^[*\s]*[a-z]/g;
1818
var RE_END_DESCRIPTION = /\n/g;
1919

2020
/**
21-
* Ensures next lines with uppercase letters have periods.
21+
* Checks next lines with uppercase letters have periods.
2222
*
2323
* This checks for the existance of a new line that starts with an
2424
* upper case letter where the previous line does not have a period
@@ -27,10 +27,10 @@ var RE_END_DESCRIPTION = /\n/g;
2727
var RE_NEW_LINE_UPPERCASE = /\w(?![.])(\W)*\n\W*[A-Z]/g;
2828

2929
/**
30-
* Ensures that a sentence followed by a blank line has a period
30+
* Checks that a sentence followed by a blank line has a period
3131
*
3232
* If the above line did not have a period this would match.
33-
* this also ensures that the last sentence in the description ends with a period.
33+
* this also checks that the last sentence in the description ends with a period.
3434
*
3535
* This also matches white-space followed by a period.
3636
*/

0 commit comments

Comments
 (0)