Skip to content

Commit cbec35f

Browse files
committed
fix(require-complete-description-sentence): allow triple backticks to end "sentence" and protect backtick content; fixes #66
1 parent 2e5782a commit cbec35f

File tree

3 files changed

+207
-86
lines changed

3 files changed

+207
-86
lines changed

README.md

+78-37
Original file line numberDiff line numberDiff line change
@@ -10981,39 +10981,39 @@ The following patterns are considered problems:
1098110981
function quux () {
1098210982

1098310983
}
10984-
// Message: Sentence should start with an uppercase character.
10984+
// Message: Sentences should start with an uppercase character.
1098510985

1098610986
/**
1098710987
* foo?
1098810988
*/
1098910989
function quux () {
1099010990

1099110991
}
10992-
// Message: Sentence should start with an uppercase character.
10992+
// Message: Sentences should start with an uppercase character.
1099310993

1099410994
/**
1099510995
* @description foo.
1099610996
*/
1099710997
function quux () {
1099810998

1099910999
}
11000-
// Message: Sentence should start with an uppercase character.
11000+
// Message: Sentences should start with an uppercase character.
1100111001

1100211002
/**
1100311003
* Foo)
1100411004
*/
1100511005
function quux () {
1100611006

1100711007
}
11008-
// Message: Sentence must end with a period.
11008+
// Message: Sentences must end with a period.
1100911009

1101011010
/**
1101111011
* `foo` is a variable
1101211012
*/
1101311013
function quux () {
1101411014

1101511015
}
11016-
// Message: Sentence must end with a period.
11016+
// Message: Sentences must end with a period.
1101711017

1101811018
/**
1101911019
* Foo.
@@ -11023,23 +11023,23 @@ function quux () {
1102311023
function quux () {
1102411024

1102511025
}
11026-
// Message: Sentence should start with an uppercase character.
11026+
// Message: Sentences should start with an uppercase character.
1102711027

1102811028
/**
1102911029
* тест.
1103011030
*/
1103111031
function quux () {
1103211032

1103311033
}
11034-
// Message: Sentence should start with an uppercase character.
11034+
// Message: Sentences should start with an uppercase character.
1103511035

1103611036
/**
1103711037
* Foo
1103811038
*/
1103911039
function quux () {
1104011040

1104111041
}
11042-
// Message: Sentence must end with a period.
11042+
// Message: Sentences must end with a period.
1104311043

1104411044
/**
1104511045
* Foo
@@ -11049,7 +11049,7 @@ function quux () {
1104911049
function quux () {
1105011050

1105111051
}
11052-
// Message: Sentence must end with a period.
11052+
// Message: Sentences must end with a period.
1105311053

1105411054
/**
1105511055
* Foo
@@ -11059,7 +11059,7 @@ function quux () {
1105911059

1106011060
}
1106111061
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"newlineBeforeCapsAssumesBadSentenceEnd":true}]
11062-
// Message: A line of text is started with an uppercase character, but preceding line does not end the sentence.
11062+
// Message: A line of text is started with an uppercase character, but the preceding line does not end the sentence.
1106311063

1106411064
/**
1106511065
* Foo.
@@ -11069,7 +11069,7 @@ function quux () {
1106911069
function quux (foo) {
1107011070

1107111071
}
11072-
// Message: Sentence should start with an uppercase character.
11072+
// Message: Sentences should start with an uppercase character.
1107311073

1107411074
/**
1107511075
* Foo.
@@ -11079,15 +11079,15 @@ function quux (foo) {
1107911079
function quux (foo) {
1108011080

1108111081
}
11082-
// Message: Sentence should start with an uppercase character.
11082+
// Message: Sentences should start with an uppercase character.
1108311083

1108411084
/**
1108511085
* {@see Foo.bar} buz
1108611086
*/
1108711087
function quux (foo) {
1108811088

1108911089
}
11090-
// Message: Sentence should start with an uppercase character.
11090+
// Message: Sentences should start with an uppercase character.
1109111091

1109211092
/**
1109311093
* Foo.
@@ -11097,7 +11097,7 @@ function quux (foo) {
1109711097
function quux (foo) {
1109811098

1109911099
}
11100-
// Message: Sentence should start with an uppercase character.
11100+
// Message: Sentences should start with an uppercase character.
1110111101

1110211102
/**
1110311103
* Foo.
@@ -11107,7 +11107,7 @@ function quux (foo) {
1110711107
function quux (foo) {
1110811108

1110911109
}
11110-
// Message: Sentence should start with an uppercase character.
11110+
// Message: Sentences should start with an uppercase character.
1111111111

1111211112
/**
1111311113
* lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque elit diam,
@@ -11120,31 +11120,31 @@ function quux (foo) {
1112011120
function longDescription (foo) {
1112111121

1112211122
}
11123-
// Message: Sentence should start with an uppercase character.
11123+
// Message: Sentences should start with an uppercase character.
1112411124

1112511125
/**
1112611126
* @arg {number} foo - Foo
1112711127
*/
1112811128
function quux (foo) {
1112911129

1113011130
}
11131-
// Message: Sentence must end with a period.
11131+
// Message: Sentences must end with a period.
1113211132

1113311133
/**
1113411134
* @argument {number} foo - Foo
1113511135
*/
1113611136
function quux (foo) {
1113711137

1113811138
}
11139-
// Message: Sentence must end with a period.
11139+
// Message: Sentences must end with a period.
1114011140

1114111141
/**
1114211142
* @return {number} foo
1114311143
*/
1114411144
function quux (foo) {
1114511145

1114611146
}
11147-
// Message: Sentence should start with an uppercase character.
11147+
// Message: Sentences should start with an uppercase character.
1114811148

1114911149
/**
1115011150
* Returns bar.
@@ -11154,29 +11154,29 @@ function quux (foo) {
1115411154
function quux (foo) {
1115511155

1115611156
}
11157-
// Message: Sentence should start with an uppercase character.
11157+
// Message: Sentences should start with an uppercase character.
1115811158

1115911159
/**
1116011160
* @throws {object} Hello World
1116111161
* hello world
1116211162
*/
11163-
// Message: Sentence must end with a period.
11163+
// Message: Sentences must end with a period.
1116411164

1116511165
/**
1116611166
* @summary Foo
1116711167
*/
1116811168
function quux () {
1116911169

1117011170
}
11171-
// Message: Sentence must end with a period.
11171+
// Message: Sentences must end with a period.
1117211172

1117311173
/**
1117411174
* @throws {SomeType} Foo
1117511175
*/
1117611176
function quux () {
1117711177

1117811178
}
11179-
// Message: Sentence must end with a period.
11179+
// Message: Sentences must end with a period.
1118011180

1118111181
/**
1118211182
* @see Foo
@@ -11185,7 +11185,7 @@ function quux () {
1118511185

1118611186
}
1118711187
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["see"]}]
11188-
// Message: Sentence must end with a period.
11188+
// Message: Sentences must end with a period.
1118911189

1119011190
/**
1119111191
* @param foo Foo bar
@@ -11195,7 +11195,7 @@ function quux (foo) {
1119511195
}
1119611196
// Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
1119711197
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["param"]}]
11198-
// Message: Sentence must end with a period.
11198+
// Message: Sentences must end with a period.
1119911199

1120011200
/**
1120111201
* Sorry, but this isn't a complete sentence, Mr.
@@ -11204,7 +11204,7 @@ function quux () {
1120411204

1120511205
}
1120611206
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
11207-
// Message: Sentence must end with a period.
11207+
// Message: Sentences must end with a period.
1120811208

1120911209
/**
1121011210
* Sorry, but this isn't a complete sentence Mr.
@@ -11213,7 +11213,7 @@ function quux () {
1121311213

1121411214
}
1121511215
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr."]}]
11216-
// Message: Sentence must end with a period.
11216+
// Message: Sentences must end with a period.
1121711217

1121811218
/**
1121911219
* Sorry, but this isn't a complete sentence Mr.
@@ -11222,7 +11222,7 @@ function quux () {
1122211222

1122311223
}
1122411224
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
11225-
// Message: Sentence must end with a period.
11225+
// Message: Sentences must end with a period.
1122611226

1122711227
/**
1122811228
* Sorry, but this isn't a complete sentence Mr. and Mrs.
@@ -11231,7 +11231,7 @@ function quux () {
1123111231

1123211232
}
1123311233
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr","Mrs"]}]
11234-
// Message: Sentence must end with a period.
11234+
// Message: Sentences must end with a period.
1123511235

1123611236
/**
1123711237
* This is a complete sentence. But this isn't, Mr.
@@ -11240,7 +11240,7 @@ function quux () {
1124011240

1124111241
}
1124211242
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
11243-
// Message: Sentence must end with a period.
11243+
// Message: Sentences must end with a period.
1124411244

1124511245
/**
1124611246
* This is a complete Mr. sentence. But this isn't, Mr.
@@ -11249,15 +11249,15 @@ function quux () {
1124911249

1125011250
}
1125111251
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
11252-
// Message: Sentence must end with a period.
11252+
// Message: Sentences must end with a period.
1125311253

1125411254
/**
1125511255
* This is a complete Mr. sentence.
1125611256
*/
1125711257
function quux () {
1125811258

1125911259
}
11260-
// Message: Sentence should start with an uppercase character.
11260+
// Message: Sentences should start with an uppercase character.
1126111261

1126211262
/**
1126311263
* This is fun, i.e. enjoyable, but not superlatively so, e.g. not
@@ -11266,7 +11266,7 @@ function quux () {
1126611266
function quux () {
1126711267

1126811268
}
11269-
// Message: Sentence should start with an uppercase character.
11269+
// Message: Sentences should start with an uppercase character.
1127011270

1127111271
/**
1127211272
* Do not have dynamic content; e.g. homepage. Here a simple unique id
@@ -11275,7 +11275,7 @@ function quux () {
1127511275
function quux () {
1127611276

1127711277
}
11278-
// Message: Sentence should start with an uppercase character.
11278+
// Message: Sentences should start with an uppercase character.
1127911279

1128011280
/**
1128111281
* Implements support for the
@@ -11284,7 +11284,7 @@ function quux () {
1128411284
function speak() {
1128511285
}
1128611286
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"newlineBeforeCapsAssumesBadSentenceEnd":true}]
11287-
// Message: A line of text is started with an uppercase character, but preceding line does not end the sentence.
11287+
// Message: A line of text is started with an uppercase character, but the preceding line does not end the sentence.
1128811288

1128911289
/**
1129011290
* Foo.
@@ -11295,15 +11295,15 @@ function quux (foo) {
1129511295

1129611296
}
1129711297
// "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["template"]}]
11298-
// Message: Sentence should start with an uppercase character.
11298+
// Message: Sentences should start with an uppercase character.
1129911299

1130011300
/**
1130111301
* Just a component.
1130211302
* @param {Object} props Свойства.
1130311303
* @return {ReactElement}.
1130411304
*/
1130511305
function quux () {}
11306-
// Message: Sentence must be more than punctuation.
11306+
// Message: Sentences must be more than punctuation.
1130711307
````
1130811308

1130911309
The following patterns are not considered problems:
@@ -11641,6 +11641,47 @@ export default (foo) => {
1164111641
*/
1164211642
function quux () {
1164311643

11644+
}
11645+
11646+
/**
11647+
* He wanted a few items: a jacket and shirt...
11648+
*/
11649+
function quux () {
11650+
11651+
}
11652+
11653+
/**
11654+
* The code in question was...
11655+
* ```
11656+
* alert('hello');
11657+
* ```
11658+
*/
11659+
function quux () {
11660+
11661+
}
11662+
11663+
/**
11664+
* @param {number|string|Date|Object|OverType|WhateverElse} multiType -
11665+
* Nice long explanation...
11666+
*/
11667+
function test (multiType) {
11668+
}
11669+
11670+
/**
11671+
* Any kind of fowl (e.g., a duck).
11672+
*/
11673+
function quux () {}
11674+
11675+
/**
11676+
* The code in question was...
11677+
* ```
11678+
* do something
11679+
*
11680+
* interesting
11681+
* ```
11682+
*/
11683+
function quux () {
11684+
1164411685
}
1164511686
````
1164611687

0 commit comments

Comments
 (0)