Skip to content

Commit

Permalink
fix(require-complete-description-sentence): allow triple backticks …
Browse files Browse the repository at this point in the history
…to end "sentence" and protect backtick content; fixes #66
  • Loading branch information
brettz9 committed Jan 31, 2023
1 parent 2e5782a commit cbec35f
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 86 deletions.
115 changes: 78 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10981,39 +10981,39 @@ The following patterns are considered problems:
function quux () {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* foo?
*/
function quux () {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* @description foo.
*/
function quux () {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* Foo)
*/
function quux () {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* `foo` is a variable
*/
function quux () {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* Foo.
Expand All @@ -11023,23 +11023,23 @@ function quux () {
function quux () {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* тест.
*/
function quux () {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* Foo
*/
function quux () {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* Foo
Expand All @@ -11049,7 +11049,7 @@ function quux () {
function quux () {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* Foo
Expand All @@ -11059,7 +11059,7 @@ function quux () {

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

/**
* Foo.
Expand All @@ -11069,7 +11069,7 @@ function quux () {
function quux (foo) {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* Foo.
Expand All @@ -11079,15 +11079,15 @@ function quux (foo) {
function quux (foo) {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* {@see Foo.bar} buz
*/
function quux (foo) {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* Foo.
Expand All @@ -11097,7 +11097,7 @@ function quux (foo) {
function quux (foo) {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* Foo.
Expand All @@ -11107,7 +11107,7 @@ function quux (foo) {
function quux (foo) {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

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

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* @arg {number} foo - Foo
*/
function quux (foo) {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* @argument {number} foo - Foo
*/
function quux (foo) {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* @return {number} foo
*/
function quux (foo) {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* Returns bar.
Expand All @@ -11154,29 +11154,29 @@ function quux (foo) {
function quux (foo) {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

/**
* @throws {object} Hello World
* hello world
*/
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* @summary Foo
*/
function quux () {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* @throws {SomeType} Foo
*/
function quux () {

}
// Message: Sentence must end with a period.
// Message: Sentences must end with a period.

/**
* @see Foo
Expand All @@ -11185,7 +11185,7 @@ function quux () {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/**
* This is a complete Mr. sentence.
*/
function quux () {

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

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

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

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

}
// Message: Sentence should start with an uppercase character.
// Message: Sentences should start with an uppercase character.

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

/**
* Foo.
Expand All @@ -11295,15 +11295,15 @@ function quux (foo) {

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

/**
* Just a component.
* @param {Object} props Свойства.
* @return {ReactElement}.
*/
function quux () {}
// Message: Sentence must be more than punctuation.
// Message: Sentences must be more than punctuation.
````

The following patterns are not considered problems:
Expand Down Expand Up @@ -11641,6 +11641,47 @@ export default (foo) => {
*/
function quux () {

}

/**
* He wanted a few items: a jacket and shirt...
*/
function quux () {

}

/**
* The code in question was...
* ```
* alert('hello');
* ```
*/
function quux () {

}

/**
* @param {number|string|Date|Object|OverType|WhateverElse} multiType -
* Nice long explanation...
*/
function test (multiType) {
}

/**
* Any kind of fowl (e.g., a duck).
*/
function quux () {}

/**
* The code in question was...
* ```
* do something
*
* interesting
* ```
*/
function quux () {

}
````

Expand Down
Loading

0 comments on commit cbec35f

Please sign in to comment.