@@ -246,6 +246,9 @@ Or one may set the targeted tag to an object with a custom `message`, but withou
246
246
Note that the preferred tags indicated in the ` settings.jsdoc.tagNamePreference `
247
247
map will be assumed to be defined by ` check-tag-names ` .
248
248
249
+ <a name =" eslint-plugin-jsdoc-settings-alias-preference-default-preferred-aliases " ></a >
250
+ #### Default Preferred Aliases
251
+
249
252
The defaults in ` eslint-plugin-jsdoc ` (for tags which offer
250
253
aliases) are as follows:
251
254
@@ -337,22 +340,28 @@ The format of the configuration is as follows:
337
340
- ` false ` to forbid the type
338
341
- a string to indicate the type that should be preferred in its place
339
342
(and which ` fix ` mode can replace); this can be one of the formats
340
- of the keys described above. Note that the format will not be changed
341
- unless you use a pseudo-type in the replacement (e.g.,
342
- ` 'Array.<>': 'MyArray' ` will change ` Array.<string> ` to ` MyArray.<string> ` ,
343
- preserving the dot; to get rid of the dot, you must use the pseudo-type:
344
- ` 'Array.<>': 'MyArray<>' ` which will change ` Array.<string> ` to
345
- ` MyArray<string> ` ). If you use a bare pseudo-type in the replacement,
346
- e.g., ` 'MyArray.<>': '<>' ` , the type will be converted to the format
347
- of the pseudo-type without changing the type name, i.e., ` MyArray.<string> `
348
- will become ` MyArray<string> ` but ` Array.<string> ` will not be modified.
349
- - an object with the key ` message ` to provide a specific error message
350
- when encountering the discouraged type and, if a type is to be preferred
351
- in its place, the key ` replacement ` to indicate the type that should be
352
- used in its place (and which ` fix ` mode can replace) or ` false ` if
353
- forbidding the type. The message string will have the substrings with
354
- special meaning, ` {{tagName}} ` and ` {{tagValue}} ` , replaced with their
355
- corresponding value.
343
+ of the keys described above.
344
+ - Note that the format will not be changed unless you use a pseudo-type
345
+ in the replacement. (For example, ` 'Array.<>': 'MyArray' ` will change
346
+ ` Array.<string> ` to ` MyArray.<string> ` , preserving the dot. To get rid
347
+ of the dot, you must use the pseudo-type with ` <> ` , i.e.,
348
+ ` 'Array.<>': 'MyArray<>' ` , which will change ` Array.<string> ` to
349
+ ` MyArray<string> ` ).
350
+ - If you use a _ bare_ pseudo-type in the replacement (e.g.,
351
+ ` 'MyArray.<>': '<>' ` ), the type will be converted to the format
352
+ of the pseudo-type without changing the type name. For example,
353
+ ` MyArray.<string> ` will become ` MyArray<string> ` but ` Array.<string> `
354
+ will not be modified.
355
+ - an object with:
356
+ - the key ` message ` to provide a specific error message
357
+ when encountering the discouraged type.
358
+ - The message string will have the substrings with special meaning,
359
+ ` {{tagName}} ` and ` {{tagValue}} ` , replaced with their
360
+ corresponding value.
361
+ - an optional key ` replacement ` with either of the following values:
362
+ - a string type to be preferred in its place (and which ` fix ` mode
363
+ can replace)
364
+ - ` false ` (for forbidding the type)
356
365
357
366
Note that the preferred types indicated as targets in ` settings.jsdoc.preferredTypes `
358
367
map will be assumed to be defined by ` no-undefined-types ` .
@@ -732,16 +741,16 @@ decreasing precedence:
732
741
* ` eslintrcForExamples ` - Defaults to ` true ` in adding rules
733
742
based on an ` .eslintrc.* ` file. Setting to ` false ` corresponds to
734
743
ESLint's [ ` --no-eslintrc ` ] ( https://eslint.org/docs/user-guide/command-line-interface#--no-eslintrc ) .
735
- * ` baseConfig ` - An object of rules with the same schema
736
- as ` .eslintrc.* ` for defaults
744
+ * ` baseConfig ` - Set to an object of rules with the same schema
745
+ as ` .eslintrc.* ` for defaults.
737
746
738
747
<a name =" eslint-plugin-jsdoc-rules-check-examples-options-for-determining-eslint-rule-applicability-allowinlineconfig-nodefaultexamplerules-matchingfilename-configfile-eslintrcforexamples-and-baseconfig-rules-disabled-by-default-unless-nodefaultexamplerules-is-set-to-true " ></a >
739
748
##### Rules Disabled by Default Unless <code >noDefaultExampleRules</code > is Set to <code >true</code >
740
749
741
750
* ` eol-last ` - Insisting that a newline "always" be at the end is less likely
742
- to be desired in sample code as with the code file convention
743
- * ` no-console ` - Unlikely to have inadvertent temporary debugging within
744
- examples
751
+ to be desired in sample code as with the code file convention.
752
+ * ` no-console ` - This rule is unlikely to have inadvertent temporary debugging
753
+ within examples.
745
754
* ` no-undef ` - Many variables in examples will be ` undefined ` .
746
755
* ` no-unused-vars ` - It is common to define variables for clarity without always
747
756
using them within examples.
@@ -750,9 +759,9 @@ decreasing precedence:
750
759
* ` import/no-unresolved ` - One wouldn't generally expect example paths to
751
760
resolve relative to the current JavaScript file as one would with real code.
752
761
* ` import/unambiguous ` - Snippets in examples are likely too short to always
753
- include full import/export info
754
- * ` node/no-missing-import ` - See ` import/no-unresolved `
755
- * ` node/no-missing-require ` - See ` import/no-unresolved `
762
+ include full import/export info.
763
+ * ` node/no-missing-import ` - See ` import/no-unresolved ` .
764
+ * ` node/no-missing-require ` - See ` import/no-unresolved ` .
756
765
757
766
|||
758
767
| ---| ---|
0 commit comments