@@ -2323,20 +2323,14 @@ it by setting it to `false`.
2323
2323
2324
2324
Set this to a string or array of strings representing the AST context
2325
2325
where you wish the rule to be applied (e.g., ` ClassDeclaration ` for ES6 classes).
2326
-
2327
- <a name =" eslint-plugin-jsdoc-rules-match-description-options-1-nodefaults " ></a >
2328
- ##### <code >noDefaults</code >
2329
-
2330
- By default, ` contexts ` will permit ` ArrowFunctionExpression ` ,
2331
- ` FunctionDeclaration ` , and ` FunctionExpression ` . Set this instead to ` true ` to
2332
- have ` contexts ` override these.
2326
+ Overrides the defaults.
2333
2327
2334
2328
|||
2335
2329
| ---| ---|
2336
2330
| Context| ` ArrowFunctionExpression ` , ` FunctionDeclaration ` , ` FunctionExpression ` ; others when ` contexts ` option enabled|
2337
2331
| Tags| N/A by default but see ` tags ` options|
2338
2332
| Settings||
2339
- | Options| ` contexts ` , ` noDefaults ` , ` tags ` (allows for 'param', 'arg', 'argument', 'returns', 'return'), ` matchDescription ` |
2333
+ | Options| ` contexts ` , ` tags ` (allows for 'param', 'arg', 'argument', 'returns', 'return'), ` matchDescription ` |
2340
2334
2341
2335
The following patterns are considered problems:
2342
2336
@@ -2347,7 +2341,7 @@ The following patterns are considered problems:
2347
2341
const q = class {
2348
2342
2349
2343
}
2350
- // Options: [{"contexts":["ClassExpression"],"noDefaults":true }]
2344
+ // Options: [{"contexts":["ClassExpression"]}]
2351
2345
// Message: JSDoc description does not satisfy the regex pattern.
2352
2346
2353
2347
/**
@@ -2356,7 +2350,7 @@ const q = class {
2356
2350
const q = {
2357
2351
2358
2352
};
2359
- // Options: [{"contexts":["ObjectExpression"],"noDefaults":true }]
2353
+ // Options: [{"contexts":["ObjectExpression"]}]
2360
2354
// Message: JSDoc description does not satisfy the regex pattern.
2361
2355
2362
2356
/**
@@ -2551,8 +2545,12 @@ function quux () {
2551
2545
class quux {
2552
2546
2553
2547
}
2548
+ <<<<<< < HEAD
2554
2549
// Options: [{"contexts":["ClassDeclaration"],"noDefaults":true}]
2555
2550
>>>>>> > feat (match- description): allow ` main description: string|boolean` to override or disable main description separate from default
2551
+ ====== =
2552
+ // Options: [{"contexts":["ClassDeclaration"]}]
2553
+ >>>>>> > docs: generate docs
2556
2554
// Message: JSDoc description does not satisfy the regex pattern.
2557
2555
2558
2556
class MyClass {
@@ -2561,7 +2559,7 @@ class MyClass {
2561
2559
*/
2562
2560
myClassField = 1
2563
2561
}
2564
- // Options: [{"contexts":["ClassProperty"],"noDefaults":true }]
2562
+ // Options: [{"contexts":["ClassProperty"]}]
2565
2563
// Message: JSDoc description does not satisfy the regex pattern.
2566
2564
2567
2565
/**
@@ -2570,7 +2568,7 @@ class MyClass {
2570
2568
interface quux {
2571
2569
2572
2570
}
2573
- // Options: [{"contexts":["TSInterfaceDeclaration"],"noDefaults":true }]
2571
+ // Options: [{"contexts":["TSInterfaceDeclaration"]}]
2574
2572
// Message: JSDoc description does not satisfy the regex pattern.
2575
2573
2576
2574
const myObject = {
@@ -2579,7 +2577,7 @@ const myObject = {
2579
2577
*/
2580
2578
myProp: true
2581
2579
};
2582
- // Options: [{"contexts":["Property"],"noDefaults":true }]
2580
+ // Options: [{"contexts":["Property"]}]
2583
2581
// Message: JSDoc description does not satisfy the regex pattern.
2584
2582
````
2585
2583
@@ -2740,39 +2738,39 @@ class MyClass {
2740
2738
*/
2741
2739
myClassField = 1
2742
2740
}
2743
- // Options: [{"contexts":["ClassProperty"],"noDefaults":true }]
2741
+ // Options: [{"contexts":["ClassProperty"]}]
2744
2742
2745
2743
/**
2746
2744
* Foo.
2747
2745
*/
2748
2746
interface quux {
2749
2747
2750
2748
}
2751
- // Options: [{"contexts":["TSInterfaceDeclaration"],"noDefaults":true }]
2749
+ // Options: [{"contexts":["TSInterfaceDeclaration"]}]
2752
2750
2753
2751
const myObject = {
2754
2752
/**
2755
2753
* Bad description
2756
2754
*/
2757
2755
myProp: true
2758
2756
};
2759
- // Options: [{"contexts":[],"noDefaults":true }]
2757
+ // Options: [{"contexts":[]}]
2760
2758
2761
2759
/**
2762
2760
* foo.
2763
2761
*/
2764
2762
const q = class {
2765
2763
2766
2764
}
2767
- // Options: [{"contexts":[],"noDefaults":true }]
2765
+ // Options: [{"contexts":[]}]
2768
2766
2769
2767
/**
2770
2768
* foo.
2771
2769
*/
2772
2770
const q = {
2773
2771
2774
2772
};
2775
- // Options: [{"contexts":[],"noDefaults":true }]
2773
+ // Options: [{"contexts":[]}]
2776
2774
````
2777
2775
2778
2776
@@ -3514,18 +3512,16 @@ An options object may have any of the following properties:
3514
3512
3515
3513
- ` contexts ` - Set to a string or array of strings representing the AST context
3516
3514
where you wish the rule to be applied (e.g., ` ClassDeclaration ` for ES6 classes).
3515
+ Overrides the defaults.
3517
3516
- ` exemptedBy ` - Array of tags (e.g., ` ['type'] ` ) whose presence on the document
3518
3517
block avoids the need for a ` @description ` .
3519
- - ` noDefaults ` - By default, ` contexts ` will permit ` ArrowFunctionExpression ` ,
3520
- ` FunctionDeclaration ` , and ` FunctionExpression ` . Set this instead to ` true ` to
3521
- have ` contexts ` override these.
3522
3518
3523
3519
|||
3524
3520
| ---| ---|
3525
3521
| Context| ` ArrowFunctionExpression ` , ` FunctionDeclaration ` , ` FunctionExpression ` ; others when ` contexts ` option enabled|
3526
3522
| Tags| ` description ` |
3527
3523
| Aliases| ` desc ` |
3528
- | Options| ` contexts ` , ` exemptedBy ` , ` noDefaults ` |
3524
+ | Options| ` contexts ` , ` exemptedBy ` |
3529
3525
3530
3526
The following patterns are considered problems:
3531
3527
@@ -3544,7 +3540,7 @@ function quux () {
3544
3540
class quux {
3545
3541
3546
3542
}
3547
- // Options: [{"contexts":"ClassDeclaration"}]
3543
+ // Options: [{"contexts":[ "ClassDeclaration"] }]
3548
3544
// Message: Missing JSDoc @description declaration.
3549
3545
3550
3546
/**
@@ -3553,7 +3549,7 @@ class quux {
3553
3549
class quux {
3554
3550
3555
3551
}
3556
- // Options: [{"contexts":"ClassDeclaration","noDefaults":true }]
3552
+ // Options: [{"contexts":[ "ClassDeclaration"] }]
3557
3553
// Message: Missing JSDoc @description declaration.
3558
3554
3559
3555
/**
@@ -3579,7 +3575,7 @@ function quux () {
3579
3575
interface quux {
3580
3576
3581
3577
}
3582
- // Options: [{"contexts":["TSInterfaceDeclaration"],"noDefaults":true }]
3578
+ // Options: [{"contexts":["TSInterfaceDeclaration"]}]
3583
3579
// Message: Missing JSDoc @description declaration.
3584
3580
<<<<<< < HEAD
3585
3581
@@ -3647,7 +3643,7 @@ class quux {
3647
3643
function quux () {
3648
3644
3649
3645
}
3650
- // Options: [{"noDefaults":true }]
3646
+ // Options: [{"contexts":["ClassDeclaration"] }]
3651
3647
3652
3648
/**
3653
3649
* @type {MyCallback}
@@ -3947,8 +3943,6 @@ be checked by the rule.
3947
3943
3948
3944
- ` contexts ` - Set this to a string or array of strings representing the additional
3949
3945
AST context where you wish the rule to be applied (e.g., ` Property ` for properties).
3950
- Note that unlike ` require-description ` and ` match-description ` , this rule has no
3951
- ` noDefaults ` option because its defaults are instead set up by ` require ` .
3952
3946
3953
3947
|||
3954
3948
| ---| ---|
0 commit comments