@@ -7930,17 +7930,23 @@ If the string is `"always"` then a problem is raised when there is no hyphen
7930
7930
before the description. If it is `"never"` then a problem is raised when there
7931
7931
is a hyphen before the description. The default value is `"always"`.
7932
7932
7933
- The options object may have the following properties:
7933
+ The options object may have the following properties to indicate behavior for
7934
+ other tags besides the `@param` tag (or the `@arg` tag if so set):
7934
7935
7935
- - `checkProperties` - Boolean on whether to also apply the rule to `@property`
7936
- tags.
7936
+ - `tags` - Object whose keys indicate different tags to check for the
7937
+ presence or absence of hyphens; the key value should be "always" or "never",
7938
+ indicating how hyphens are to be applied, e.g., `{property: ' never' }`
7939
+ to ensure `@property` never uses hyphens. A key can also be set as `*`, e.g.,
7940
+ `' * ' : ' always' ` to apply hyphen checking to any tag (besides the preferred
7941
+ `@param` tag which follows the main string option setting and besides any
7942
+ other `tags` entries).
7937
7943
7938
7944
|||
7939
7945
|---|---|
7940
7946
|Context|everywhere|
7941
- |Tags|`param` and optionally `property `|
7942
- |Aliases|`arg`, `argument`; optionally `prop`|
7943
- |Options|(a string matching `"always"|"never"`) followed by an optional object with a `checkProperties ` property|
7947
+ |Tags|`param` and optionally other tags within `tags `|
7948
+ |Aliases|`arg`, `argument`; potentially `prop` or other aliases |
7949
+ |Options|(a string matching `"always"|"never"`) followed by an optional object with a `tags ` property|
7944
7950
7945
7951
The following patterns are considered problems:
7946
7952
@@ -7959,6 +7965,25 @@ function quux () {
7959
7965
*/
7960
7966
function quux () {
7961
7967
7968
+ }
7969
+ // Options: ["always",{"tags":{"*":"never"}}]
7970
+ // Message: There must be a hyphen before @param description.
7971
+
7972
+ /**
7973
+ * @param foo Foo.
7974
+ * @returns {SomeType} - Hyphen here.
7975
+ */
7976
+ function quux () {
7977
+
7978
+ }
7979
+ // Options: ["always",{"tags":{"*":"never","returns":"always"}}]
7980
+ // Message: There must be a hyphen before @param description.
7981
+
7982
+ /**
7983
+ * @param foo Foo.
7984
+ */
7985
+ function quux () {
7986
+
7962
7987
}
7963
7988
// Message: There must be a hyphen before @param description.
7964
7989
@@ -8005,15 +8030,25 @@ function quux (foo) {
8005
8030
* @typedef {SomeType} ATypeDefName
8006
8031
* @property foo Foo.
8007
8032
*/
8008
- // Options: ["always",{"checkProperties":true }]
8033
+ // Options: ["always",{"tags":{"property":"always"} }]
8009
8034
// Message: There must be a hyphen before @property description.
8010
8035
8011
8036
/**
8012
8037
* @typedef {SomeType} ATypeDefName
8013
8038
* @property foo - Foo.
8014
8039
*/
8015
- // Options: ["never",{"checkProperties":true }]
8040
+ // Options: ["never",{"tags":{"property":"never"} }]
8016
8041
// Message: There must be no hyphen before @property description.
8042
+
8043
+ /**
8044
+ * @param foo Foo.
8045
+ * @returns {SomeType} - A description.
8046
+ */
8047
+ function quux () {
8048
+
8049
+ }
8050
+ // Options: ["always",{"tags":{"returns":"never"}}]
8051
+ // Message: There must be a hyphen before @param description.
8017
8052
````
8018
8053
8019
8054
The following patterns are not considered problems:
@@ -8027,6 +8062,15 @@ function quux () {
8027
8062
}
8028
8063
// Options: ["always"]
8029
8064
8065
+ /**
8066
+ * @param foo - Foo.
8067
+ * @returns {SomeType} A description.
8068
+ */
8069
+ function quux () {
8070
+
8071
+ }
8072
+ // Options: ["always",{"tags":{"returns":"never"}}]
8073
+
8030
8074
/**
8031
8075
* @param foo Foo.
8032
8076
*/
@@ -8042,17 +8086,31 @@ function quux () {
8042
8086
8043
8087
}
8044
8088
8089
+ /**
8090
+ *
8091
+ */
8092
+ function quux () {
8093
+
8094
+ }
8095
+ // Options: ["always",{"tags":{"*":"always"}}]
8096
+
8045
8097
/**
8046
8098
* @typedef {SomeType} ATypeDefName
8047
8099
* @property foo - Foo.
8048
8100
*/
8049
- // Options: ["always",{"checkProperties":true }]
8101
+ // Options: ["always",{"tags":{"property":"always"} }]
8050
8102
8051
8103
/**
8052
8104
* @typedef {SomeType} ATypeDefName
8053
8105
* @property foo Foo.
8054
8106
*/
8055
- // Options: ["never",{"checkProperties":true}]
8107
+ // Options: ["never",{"tags":{"property":"never"}}]
8108
+
8109
+ /**
8110
+ * @typedef {SomeType} ATypeDefName
8111
+ * @property foo - Foo.
8112
+ */
8113
+ // Options: ["never",{"tags":{"*":"always"}}]
8056
8114
````
8057
8115
8058
8116
0 commit comments