Skip to content

Commit 2b0364a

Browse files
Update dependency eslint-plugin-jsdoc to v46 (#497)
1 parent ee07640 commit 2b0364a

24 files changed

Lines changed: 421 additions & 109 deletions

.changeset/hip-boxes-speak.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
'@cloudfour/eslint-plugin': major
3+
---
4+
5+
Update `eslint-plugin-jsdoc` from `v39` to `v46`
6+
7+
**Reconfigured Rules**
8+
9+
The `@cloudfour/jsdoc/tag-lines` rule is now configured to enforce one blank line in JSDoc comments between the description of a function and the `@param`/other tags.
10+
11+
For example, the blank line after the description is enforced here:
12+
13+
```js
14+
/**
15+
* This is the description for the function, the blank line below this is enforced
16+
*
17+
* @param {string} name A parameter called name
18+
*/
19+
function someFunction(name) {}
20+
```
21+
22+
**New Rules**
23+
24+
- [`@cloudfour/jsdoc/informative-docs`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/informative-docs.md#repos-sticky-header)
25+
- [`@cloudfour/jsdoc/no-blank-block-descriptions`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-block-descriptions.md#repos-sticky-header)
26+
- [`@cloudfour/jsdoc/no-blank-blocks`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-blocks.md#repos-sticky-header)
27+
28+
**Deleted Rules**
29+
30+
- [`@cloudfour/jsdoc/newline-after-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description)
31+
32+
**Newly Enabled Rules**
33+
34+
- [`@cloudfour/jsdoc/no-defaults`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-defaults.md#repos-sticky-header)

fixtures/eslint/lib/cli-engine/cascading-config-array-factory.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const internalSlotsMap = new WeakMap();
8181

8282
/**
8383
* Create the config array from `baseConfig` and `rulePaths`.
84+
*
8485
* @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.
8586
* @returns {ConfigArray} The config array of the base configs.
8687
*/
@@ -139,6 +140,7 @@ function createBaseConfigArray({
139140

140141
/**
141142
* Create the config array from CLI options.
143+
*
142144
* @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.
143145
* @returns {ConfigArray} The config array of the base configs.
144146
*/
@@ -192,6 +194,7 @@ class ConfigurationNotFoundError extends Error {
192194
class CascadingConfigArrayFactory {
193195
/**
194196
* Initialize this enumerator.
197+
*
195198
* @param {CascadingConfigArrayFactoryOptions} options The options.
196199
*/
197200
constructor({
@@ -241,6 +244,7 @@ class CascadingConfigArrayFactory {
241244
/**
242245
* The path to the current working directory.
243246
* This is used by tests.
247+
*
244248
* @type {string}
245249
*/
246250
get cwd() {
@@ -253,6 +257,7 @@ class CascadingConfigArrayFactory {
253257
* Get the config array of a given file.
254258
* If `filePath` was not given, it returns the config which contains only
255259
* `baseConfigData` and `cliConfigData`.
260+
*
256261
* @param {string} [filePath] The file path to a file.
257262
* @param {object} [options] The options.
258263
* @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.
@@ -278,6 +283,7 @@ class CascadingConfigArrayFactory {
278283

279284
/**
280285
* Clear config cache.
286+
*
281287
* @returns {void}
282288
*/
283289
clearCache() {
@@ -290,6 +296,7 @@ class CascadingConfigArrayFactory {
290296

291297
/**
292298
* Load and normalize config files from the ancestor directories.
299+
*
293300
* @param {string} directoryPath The path to a leaf directory.
294301
* @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories.
295302
* @returns {ConfigArray} The loaded config.
@@ -376,6 +383,7 @@ class CascadingConfigArrayFactory {
376383

377384
/**
378385
* Freeze and cache a given config.
386+
*
379387
* @param {string} directoryPath The path to a directory as a cache key.
380388
* @param {ConfigArray} configArray The config array as a cache value.
381389
* @returns {ConfigArray} The `configArray` (frozen).
@@ -392,6 +400,7 @@ class CascadingConfigArrayFactory {
392400
/**
393401
* Finalize a given config array.
394402
* Concatenate `--config` and other CLI options.
403+
*
395404
* @param {ConfigArray} configArray The parent config array.
396405
* @param {string} directoryPath The path to the leaf directory to find config files.
397406
* @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.

fixtures/eslint/lib/cli-engine/config-array-factory.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ const internalSlotsMap = new WeakMap();
111111

112112
/**
113113
* Check if a given string is a file path.
114+
*
114115
* @param {string} nameOrPath A module name or file path.
115116
* @returns {boolean} `true` if the `nameOrPath` is a file path.
116117
*/
@@ -120,6 +121,7 @@ function isFilePath(nameOrPath) {
120121

121122
/**
122123
* Convenience wrapper for synchronously reading file contents.
124+
*
123125
* @param {string} filePath The filename to read.
124126
* @returns {string} The file contents, with the BOM removed.
125127
* @private
@@ -130,6 +132,7 @@ function readFile(filePath) {
130132

131133
/**
132134
* Loads a YAML configuration from a file.
135+
*
133136
* @param {string} filePath The filename to load.
134137
* @returns {ConfigData} The configuration object from the file.
135138
* @throws {Error} If the file cannot be read.
@@ -153,6 +156,7 @@ function loadYAMLConfigFile(filePath) {
153156

154157
/**
155158
* Loads a JSON configuration from a file.
159+
*
156160
* @param {string} filePath The filename to load.
157161
* @returns {ConfigData} The configuration object from the file.
158162
* @throws {Error} If the file cannot be read.
@@ -177,6 +181,7 @@ function loadJSONConfigFile(filePath) {
177181

178182
/**
179183
* Loads a legacy (.eslintrc) configuration from a file.
184+
*
180185
* @param {string} filePath The filename to load.
181186
* @returns {ConfigData} The configuration object from the file.
182187
* @throws {Error} If the file cannot be read.
@@ -202,6 +207,7 @@ function loadLegacyConfigFile(filePath) {
202207

203208
/**
204209
* Loads a JavaScript configuration from a file.
210+
*
205211
* @param {string} filePath The filename to load.
206212
* @returns {ConfigData} The configuration object from the file.
207213
* @throws {Error} If the file cannot be read.
@@ -220,6 +226,7 @@ function loadJSConfigFile(filePath) {
220226

221227
/**
222228
* Loads a configuration from a package.json file.
229+
*
223230
* @param {string} filePath The filename to load.
224231
* @returns {ConfigData} The configuration object from the file.
225232
* @throws {Error} If the file cannot be read.
@@ -247,6 +254,7 @@ function loadPackageJSONConfigFile(filePath) {
247254

248255
/**
249256
* Loads a `.eslintignore` from a file.
257+
*
250258
* @param {string} filePath The filename to load.
251259
* @returns {string[]} The ignore patterns from the file.
252260
* @private
@@ -267,6 +275,7 @@ function loadESLintIgnoreFile(filePath) {
267275

268276
/**
269277
* Creates an error to notify about a missing config to extend from.
278+
*
270279
* @param {string} configName The name of the missing config.
271280
* @param {string} importerName The name of the config that imported the missing config
272281
* @returns {Error} The error object to throw
@@ -285,6 +294,7 @@ function configMissingError(configName, importerName) {
285294
/**
286295
* Loads a configuration file regardless of the source. Inspects the file path
287296
* to determine the correctly way to load the config file.
297+
*
288298
* @param {string} filePath The path to the configuration.
289299
* @returns {ConfigData|null} The configuration information.
290300
* @private
@@ -317,6 +327,7 @@ function loadConfigFile(filePath) {
317327

318328
/**
319329
* Write debug log.
330+
*
320331
* @param {string} request The requested module name.
321332
* @param {string} relativeTo The file path to resolve the request relative to.
322333
* @param {string} filePath The resolved file path.
@@ -345,6 +356,7 @@ function writeDebugLogForLoading(request, relativeTo, filePath) {
345356

346357
/**
347358
* Create a new context with default values.
359+
*
348360
* @param {string | undefined} cwd The current working directory.
349361
* @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`.
350362
* @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`.
@@ -373,6 +385,7 @@ function createContext(
373385
* Normalize a given plugin.
374386
* - Ensure the object to have four properties: configs, environments, processors, and rules.
375387
* - Ensure the object to not have other properties.
388+
*
376389
* @param {Plugin} plugin The plugin to normalize.
377390
* @returns {Plugin} The normalized plugin.
378391
*/
@@ -395,6 +408,7 @@ function normalizePlugin(plugin) {
395408
class ConfigArrayFactory {
396409
/**
397410
* Initialize this instance.
411+
*
398412
* @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.
399413
*/
400414
constructor({
@@ -411,6 +425,7 @@ class ConfigArrayFactory {
411425

412426
/**
413427
* Create `ConfigArray` instance from a config data.
428+
*
414429
* @param {ConfigData|null} configData The config data to create.
415430
* @param {object} [options] The options.
416431
* @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
@@ -432,6 +447,7 @@ class ConfigArrayFactory {
432447

433448
/**
434449
* Load a config file.
450+
*
435451
* @param {string} filePath The path to a config file.
436452
* @param {object} [options] The options.
437453
* @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
@@ -447,6 +463,7 @@ class ConfigArrayFactory {
447463

448464
/**
449465
* Load the config file on a given directory if exists.
466+
*
450467
* @param {string} directoryPath The path to a directory.
451468
* @param {object} [options] The options.
452469
* @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
@@ -489,6 +506,7 @@ class ConfigArrayFactory {
489506

490507
/**
491508
* Check if a config file on a given directory exists or not.
509+
*
492510
* @param {string} directoryPath The path to a directory.
493511
* @returns {string | null} The path to the found config file. If not found then null.
494512
*/
@@ -515,6 +533,7 @@ class ConfigArrayFactory {
515533

516534
/**
517535
* Load `.eslintignore` file.
536+
*
518537
* @param {string} filePath The path to a `.eslintignore` file to load.
519538
* @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
520539
*/
@@ -531,6 +550,7 @@ class ConfigArrayFactory {
531550

532551
/**
533552
* Load `.eslintignore` file in the current working directory.
553+
*
534554
* @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
535555
*/
536556
loadDefaultESLintIgnore() {
@@ -571,6 +591,7 @@ class ConfigArrayFactory {
571591

572592
/**
573593
* Load a given config file.
594+
*
574595
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
575596
* @returns {IterableIterator<ConfigArrayElement>} Loaded config.
576597
* @private
@@ -581,6 +602,7 @@ class ConfigArrayFactory {
581602

582603
/**
583604
* Normalize a given `.eslintignore` data to config array elements.
605+
*
584606
* @param {string[]} ignorePatterns The patterns to ignore files.
585607
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
586608
* @yields {ConfigArrayElement} The normalized config.
@@ -601,6 +623,7 @@ class ConfigArrayFactory {
601623

602624
/**
603625
* Normalize a given config to an array.
626+
*
604627
* @param {ConfigData} configData The config data to normalize.
605628
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
606629
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
@@ -613,6 +636,7 @@ class ConfigArrayFactory {
613636

614637
/**
615638
* Normalize a given config to an array.
639+
*
616640
* @param {ConfigData|OverrideConfigData} configData The config data to normalize.
617641
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
618642
* @yields {ConfigArrayElement} The normalized config.
@@ -650,6 +674,7 @@ class ConfigArrayFactory {
650674

651675
/**
652676
* Normalize a given config to an array.
677+
*
653678
* @param {ConfigData} configData The config data to normalize.
654679
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
655680
* @yields {ConfigArrayElement} The normalized config.
@@ -730,6 +755,7 @@ class ConfigArrayFactory {
730755

731756
/**
732757
* Load configs of an element in `extends`.
758+
*
733759
* @param {string} extendName The name of a base config.
734760
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
735761
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
@@ -755,6 +781,7 @@ class ConfigArrayFactory {
755781

756782
/**
757783
* Load configs of an element in `extends`.
784+
*
758785
* @param {string} extendName The name of a base config.
759786
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
760787
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
@@ -782,6 +809,7 @@ class ConfigArrayFactory {
782809

783810
/**
784811
* Load configs of an element in `extends`.
812+
*
785813
* @param {string} extendName The name of a base config.
786814
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
787815
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
@@ -813,6 +841,7 @@ class ConfigArrayFactory {
813841

814842
/**
815843
* Load configs of an element in `extends`.
844+
*
816845
* @param {string} extendName The name of a base config.
817846
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
818847
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
@@ -854,6 +883,7 @@ class ConfigArrayFactory {
854883

855884
/**
856885
* Load given plugins.
886+
*
857887
* @param {string[]} names The plugin names to load.
858888
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
859889
* @returns {Record<string,DependentPlugin>} The loaded parser.
@@ -873,6 +903,7 @@ class ConfigArrayFactory {
873903

874904
/**
875905
* Load a given parser.
906+
*
876907
* @param {string} nameOrPath The package name or the path to a parser file.
877908
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
878909
* @returns {DependentParser} The loaded parser.
@@ -926,6 +957,7 @@ class ConfigArrayFactory {
926957

927958
/**
928959
* Load a given plugin.
960+
*
929961
* @param {string} name The plugin name to load.
930962
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
931963
* @returns {DependentPlugin} The loaded plugin.
@@ -1025,6 +1057,7 @@ class ConfigArrayFactory {
10251057

10261058
/**
10271059
* Take file expression processors as config array elements.
1060+
*
10281061
* @param {Record<string,DependentPlugin>} plugins The plugin definitions.
10291062
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
10301063
* @yields {ConfigArrayElement} The config array elements of file expression processors.

0 commit comments

Comments
 (0)