@@ -2285,7 +2285,7 @@ The default is this basic expression to match English sentences (Support
2285
2285
for Unicode upper case may be added in a future version when it can be handled
2286
2286
by our supported Node versions):
2287
2287
2288
- `` ^([A-Z]|[`\\d_])( [\\s\\S]*[.?!`])? $ ``
2288
+ `` ^([A-Z]|[`\\d_])[\\s\\S]*[.?!`]$ ``
2289
2289
2290
2290
<a name =" eslint-plugin-jsdoc-rules-match-description-options-1 " ></a >
2291
2291
#### Options
@@ -2400,7 +2400,7 @@ function quux () {
2400
2400
// Message: JSDoc description does not satisfy the regex pattern.
2401
2401
2402
2402
/**
2403
- * тест .
2403
+ * Abc .
2404
2404
*/
2405
2405
function quux () {
2406
2406
@@ -2563,6 +2563,33 @@ class quux {
2563
2563
// Options: [{"contexts":["ClassDeclaration"],"noDefaults":true}]
2564
2564
>>>>>> > feat (match- description): allow ` main description: string|boolean` to override or disable main description separate from default
2565
2565
// Message: JSDoc description does not satisfy the regex pattern.
2566
+
2567
+ class MyClass {
2568
+ /**
2569
+ * Abc
2570
+ */
2571
+ myClassField = 1
2572
+ }
2573
+ // Options: [{"contexts":["ClassProperty"],"noDefaults":true}]
2574
+ // Message: JSDoc description does not satisfy the regex pattern.
2575
+
2576
+ /**
2577
+ * foo.
2578
+ */
2579
+ interface quux {
2580
+
2581
+ }
2582
+ // Options: [{"contexts":["TSInterfaceDeclaration"],"noDefaults":true}]
2583
+ // Message: JSDoc description does not satisfy the regex pattern.
2584
+
2585
+ const myObject = {
2586
+ /**
2587
+ * Bad description
2588
+ */
2589
+ myProp: true
2590
+ };
2591
+ // Options: [{"contexts":["Property"],"noDefaults":true}]
2592
+ // Message: JSDoc description does not satisfy the regex pattern.
2566
2593
````
2567
2594
2568
2595
The following patterns are not considered problems:
@@ -2715,6 +2742,30 @@ class quux {
2715
2742
2716
2743
}
2717
2744
// Options: [{"tags":{"main description":true}}]
2745
+
2746
+ class MyClass {
2747
+ /**
2748
+ * Abc.
2749
+ */
2750
+ myClassField = 1
2751
+ }
2752
+ // Options: [{"contexts":["ClassProperty"],"noDefaults":true}]
2753
+
2754
+ /**
2755
+ * Foo.
2756
+ */
2757
+ interface quux {
2758
+
2759
+ }
2760
+ // Options: [{"contexts":["TSInterfaceDeclaration"],"noDefaults":true}]
2761
+
2762
+ const myObject = {
2763
+ /**
2764
+ * Bad description
2765
+ */
2766
+ myProp: true
2767
+ };
2768
+ // Options: [{"contexts":[],"noDefaults":true}]
2718
2769
````
2719
2770
2720
2771
@@ -3523,6 +3574,7 @@ interface quux {
3523
3574
}
3524
3575
// Options: [{"contexts":["TSInterfaceDeclaration"],"noDefaults":true}]
3525
3576
// Message: Missing JSDoc @description declaration.
3577
+ <<<<<< < HEAD
3526
3578
3527
3579
/**
3528
3580
*
@@ -3541,6 +3593,8 @@ var quux = {
3541
3593
};
3542
3594
// Options: [{"contexts":["ObjectExpression"]}]
3543
3595
// Message: Missing JSDoc @description declaration.
3596
+ ====== =
3597
+ >>>>>> > fix (match- description): tighten default regex to require punctuation at the end even if only a single character
3544
3598
````
3545
3599
3546
3600
The following patterns are not considered problems:
@@ -3602,6 +3656,7 @@ function quux () {
3602
3656
interface quux {
3603
3657
3604
3658
}
3659
+ <<<<<< < HEAD
3605
3660
3606
3661
/**
3607
3662
*
@@ -3616,6 +3671,9 @@ var quux = class {
3616
3671
var quux = {
3617
3672
3618
3673
};
3674
+ ====== =
3675
+ // Message: Missing JSDoc @description declaration.
3676
+ >>>>>> > fix (match- description): tighten default regex to require punctuation at the end even if only a single character
3619
3677
````
3620
3678
3621
3679
@@ -3883,6 +3941,11 @@ be checked by the rule.
3883
3941
- ` FunctionExpression `
3884
3942
- ` MethodDefinition `
3885
3943
3944
+ - ` contexts ` - Set this to a string or array of strings representing the additional
3945
+ AST context where you wish the rule to be applied (e.g., ` Property ` for properties).
3946
+ Note that unlike ` require-description ` and ` match-description ` , this rule has no
3947
+ ` noDefaults ` option because its defaults are instead set up by ` require ` .
3948
+
3886
3949
|||
3887
3950
| ---| ---|
3888
3951
| Context| ` ArrowFunctionExpression ` , ` ClassDeclaration ` , ` ClassExpression ` , ` FunctionDeclaration ` , ` FunctionExpression ` |
@@ -4214,6 +4277,12 @@ export function someMethod() {
4214
4277
}
4215
4278
// Options: [{"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionDeclaration":true}}]
4216
4279
// Message: Missing JSDoc comment.
4280
+
4281
+ const myObject = {
4282
+ myProp: true
4283
+ };
4284
+ // Options: [{"contexts":["Property"]}]
4285
+ // Message: Missing JSDoc comment.
4217
4286
````
4218
4287
4219
4288
The following patterns are not considered problems:
@@ -4683,6 +4752,11 @@ exports.someMethod = function() {
4683
4752
4684
4753
}
4685
4754
// Options: [{"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionExpression":true}}]
4755
+
4756
+ const myObject = {
4757
+ myProp: true
4758
+ };
4759
+ // Options: [{"contexts":[]}]
4686
4760
````
4687
4761
4688
4762
0 commit comments