Skip to content

Commit 765f6ed

Browse files
committed
Merge branch 'master' into add-more-type-checks-to-valid-types
* master: chore: change the process for generatng readme fix: Fix wrong alignment docs: generate docs fix: Exclude line slicing by zero. chore: update comment-parser and gitdown deps. fix: Fix trim bug in trimCode docs: generate docs fix: Remove unformatted space
2 parents 602d210 + 5675695 commit 765f6ed

File tree

9 files changed

+227
-170
lines changed

9 files changed

+227
-170
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ sudo: false
1515
script:
1616
- npm run test
1717
- 'if [ -n "${LINT-}" ]; then npm run lint; fi'
18+
- 'if [ -n "${CHECK_README-}" ]; then npm run check-readme; fi'
1819
- npm run build
1920
env:
2021
matrix:
@@ -25,6 +26,8 @@ matrix:
2526
include:
2627
- node_js: 'lts/*'
2728
env: LINT=true
29+
- node_js: 'lts/*'
30+
env: CHECK_README=true
2831
exclude:
2932
- node_js: 6
3033
env: ESLINT=6

README.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,15 @@ function quux (foo) {
388388
}
389389
// Message: Expected JSDoc block to be aligned.
390390

391-
/**
391+
/**
392392
* @param {Number} foo
393393
*/
394394
function quux (foo) {
395395

396396
}
397397
// Message: Expected JSDoc block to be aligned.
398398

399-
/**
399+
/**
400400
* @param {Number} foo
401401
*/
402402
function quux (foo) {
@@ -405,16 +405,16 @@ function quux (foo) {
405405
// Message: Expected JSDoc block to be aligned.
406406

407407
/**
408-
* @param {Number} foo
409-
*/
410-
function quux (foo) {
408+
* @param {Number} foo
409+
*/
410+
function quux (foo) {
411411

412-
}
412+
}
413413
// Message: Expected JSDoc block to be aligned.
414414

415415
/**
416-
* A jsdoc not attached to any node.
417-
*/
416+
* A jsdoc not attached to any node.
417+
*/
418418
// Message: Expected JSDoc block to be aligned.
419419

420420
class Foo {
@@ -775,10 +775,10 @@ function f () {
775775
// Message: `settings.jsdoc.captionRequired` has been removed, use options in the rule `check-examples` instead.
776776

777777
/**
778-
* @typedef {string} Foo
779-
* @example <caption></caption>
780-
* 'foo'
781-
*/
778+
* @typedef {string} Foo
779+
* @example <caption></caption>
780+
* 'foo'
781+
*/
782782
// Options: [{"captionRequired":true,"eslintrcForExamples":false}]
783783
// Message: Caption is expected for examples.
784784
````
@@ -3260,19 +3260,19 @@ function quux () {
32603260
// Message: There must be no newline after the description of the JSDoc block.
32613261

32623262
/**
3263-
* A.
3264-
*
3265-
* @typedef {Object} A
3266-
* @prop {boolean} a A.
3267-
*/
3263+
* A.
3264+
*
3265+
* @typedef {Object} A
3266+
* @prop {boolean} a A.
3267+
*/
32683268
// Options: ["never"]
32693269
// Message: There must be no newline after the description of the JSDoc block.
32703270

32713271
/**
3272-
* A.
3273-
* @typedef {Object} A
3274-
* @prop {boolean} a A.
3275-
*/
3272+
* A.
3273+
* @typedef {Object} A
3274+
* @prop {boolean} a A.
3275+
*/
32763276
// Options: ["always"]
32773277
// Message: There must be a newline after the description of the JSDoc block.
32783278
````
@@ -3411,17 +3411,17 @@ The following patterns are considered problems:
34113411

34123412
````js
34133413
/**
3414-
* @param {HerType} baz - Foo.
3415-
*/
3414+
* @param {HerType} baz - Foo.
3415+
*/
34163416
function quux(foo, bar, baz) {
34173417

34183418
}
34193419
// Settings: {"jsdoc":{"preferredTypes":{"HerType":1000}}}
34203420
// Message: Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.
34213421

34223422
/**
3423-
* @param {HerType} baz - Foo.
3424-
*/
3423+
* @param {HerType} baz - Foo.
3424+
*/
34253425
function quux(foo, bar, baz) {
34263426

34273427
}
@@ -3437,28 +3437,28 @@ function quux(foo) {
34373437
// Message: The type 'strnig' is undefined.
34383438

34393439
/**
3440-
* @param {MyType} foo - Bar.
3441-
* @param {HisType} bar - Foo.
3442-
*/
3440+
* @param {MyType} foo - Bar.
3441+
* @param {HisType} bar - Foo.
3442+
*/
34433443
function quux(foo, bar) {
34443444

34453445
}
34463446
// Options: [{"definedTypes":["MyType"]}]
34473447
// Message: The type 'HisType' is undefined.
34483448

34493449
/**
3450-
* @param {MyType} foo - Bar.
3451-
* @param {HisType} bar - Foo.
3452-
* @param {HerType} baz - Foo.
3453-
*/
3450+
* @param {MyType} foo - Bar.
3451+
* @param {HisType} bar - Foo.
3452+
* @param {HerType} baz - Foo.
3453+
*/
34543454
function quux(foo, bar, baz) {
34553455

34563456
}
34573457
// Settings: {"jsdoc":{"preferredTypes":{"hertype":{"replacement":"HerType"}}}}
34583458
// Options: [{"definedTypes":["MyType"]}]
34593459
// Message: The type 'HisType' is undefined.
34603460

3461-
/**
3461+
/**
34623462
* @param {MyType} foo - Bar.
34633463
* @param {HisType} bar - Foo.
34643464
* @param {HerType} baz - Foo.
@@ -3634,30 +3634,30 @@ function foo () {
36343634
}
36353635

36363636
/**
3637-
* @param {MyType} foo - Bar.
3638-
* @param {HisType} bar - Foo.
3639-
*/
3637+
* @param {MyType} foo - Bar.
3638+
* @param {HisType} bar - Foo.
3639+
*/
36403640
function quux(foo, bar) {
36413641

36423642
}
36433643
// Options: [{"definedTypes":["MyType","HisType"]}]
36443644

36453645
/**
3646-
* @param {MyType} foo - Bar.
3647-
* @param {HisType} bar - Foo.
3648-
* @param {HerType} baz - Foo.
3649-
*/
3646+
* @param {MyType} foo - Bar.
3647+
* @param {HisType} bar - Foo.
3648+
* @param {HerType} baz - Foo.
3649+
*/
36503650
function quux(foo, bar, baz) {
36513651

36523652
}
36533653
// Settings: {"jsdoc":{"preferredTypes":{"hertype":{"replacement":"HerType"},"histype":"HisType"}}}
36543654
// Options: [{"definedTypes":["MyType"]}]
36553655

36563656
/**
3657-
* @param {MyType} foo - Bar.
3658-
* @param {HisType} bar - Foo.
3659-
* @param {HerType} baz - Foo.
3660-
*/
3657+
* @param {MyType} foo - Bar.
3658+
* @param {HisType} bar - Foo.
3659+
* @param {HerType} baz - Foo.
3660+
*/
36613661
function quux(foo, bar, baz) {
36623662

36633663
}
@@ -5351,14 +5351,14 @@ module.exports = {
53515351
// Options: [{"publicOnly":true,"require":{"FunctionExpression":true}}]
53525352

53535353
/**
5354-
*
5355-
*/
5354+
*
5355+
*/
53565356
function test() {
53575357

53585358
}
53595359

53605360
module.exports = {
5361-
prop: { prop2: test }
5361+
prop: { prop2: test }
53625362
}
53635363
// Options: [{"publicOnly":true,"require":{"FunctionExpression":true}}]
53645364

@@ -6816,8 +6816,8 @@ const quux = async () => {}
68166816
// Message: Missing JSDoc @returns declaration.
68176817

68186818
/**
6819-
*
6820-
*/
6819+
*
6820+
*/
68216821
async function quux () {}
68226822
// Options: [{"forceRequireReturn":true}]
68236823
// Message: Missing JSDoc @returns declaration.

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"url": "http://gajus.com"
66
},
77
"dependencies": {
8-
"comment-parser": "^0.5.5",
8+
"comment-parser": "^0.6.0",
99
"debug": "^4.1.1",
1010
"flat-map-polyfill": "^0.3.8",
1111
"jsdoctypeparser": "5.0.1",
@@ -27,7 +27,7 @@
2727
"chai": "^4.2.0",
2828
"eslint": "^6.0.1",
2929
"eslint-config-canonical": "^17.1.4",
30-
"gitdown": "^2.6.2",
30+
"gitdown": "^3.1.1",
3131
"glob": "^7.1.4",
3232
"husky": "^3.0.0",
3333
"mocha": "^6.1.4",
@@ -40,8 +40,7 @@
4040
},
4141
"husky": {
4242
"hooks": {
43-
"post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify",
44-
"pre-commit": "npm run lint && npm run test && npm run build"
43+
"pre-push": "npm run lint && npm run test && npm run build && npm run check-readme"
4544
}
4645
},
4746
"keywords": [
@@ -60,9 +59,9 @@
6059
"url": "https://github.com/gajus/eslint-plugin-jsdoc"
6160
},
6261
"scripts": {
63-
"add-assertions": "babel-node ./src/bin/readme-assertions",
6462
"build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps",
65-
"create-readme": "gitdown ./.README/README.md --output-file ./README.md && npm run add-assertions",
63+
"check-readme": "babel-node ./src/bin/generateReadme.js --check",
64+
"create-readme": "babel-node ./src/bin/generateReadme.js",
6665
"lint-fix": "eslint --fix ./src ./test",
6766
"lint": "eslint ./src ./test",
6867
"test-cov": "BABEL_ENV=test nyc mocha --recursive --require @babel/register --reporter progress --timeout 9000",

0 commit comments

Comments
 (0)