Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .README/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ npm install --save-dev eslint-plugin-jsdoc

### Flat config (procedural)

This is the currently recommended approach.
This is the currently recommended approach for all flat configs (besides the
array-based `examples`, `default-expressions`, and
`examples-and-default-expressions` configs).

```js
import {jsdoc} from 'eslint-plugin-jsdoc';
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ npm install --save-dev eslint-plugin-jsdoc
<a name="eslint-plugin-jsdoc-configuration-flat-config-procedural"></a>
### Flat config (procedural)

This is the currently recommended approach.
This is the currently recommended approach for all flat configs (besides the
array-based `examples`, `default-expressions`, and
`examples-and-default-expressions` configs).

```js
import {jsdoc} from 'eslint-plugin-jsdoc';
Expand Down
2 changes: 1 addition & 1 deletion src/index-cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const buildForbidRuleDefinition = ({
* @typedef {"" | "-error"} ErrorLevelVariants
* @type {import('eslint').ESLint.Plugin & {
* configs: Record<`flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,
* import('eslint').Linter.Config>
* import('eslint').Linter.Config>|Record<"examples"|"default-expressions"|"examples-and-default-expressions", import('eslint').Linter.Config[]>
* }}
*/
const index = {};
Expand Down
4 changes: 2 additions & 2 deletions src/index-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default index;
* }
* ) => import('eslint').Linter.Config)}
*/
/* eslint-enable jsdoc/valid-types -- Bug */
export const jsdoc = function (cfg) {
/* eslint-enable jsdoc/valid-types -- Bug */
/** @type {import('eslint').Linter.Config} */
let outputConfig = {
plugins: {
Expand All @@ -52,7 +52,7 @@ export const jsdoc = function (cfg) {
throw new TypeError('Disallowed config value');
}

outputConfig = index.configs[cfg.config];
outputConfig = /** @type {import('eslint').Linter.Config} */ (index.configs[cfg.config]);
}

if (cfg.rules) {
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const buildForbidRuleDefinition = ({
* @typedef {"" | "-error"} ErrorLevelVariants
* @type {import('eslint').ESLint.Plugin & {
* configs: Record<`flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,
* import('eslint').Linter.Config>
* import('eslint').Linter.Config>|Record<"examples"|"default-expressions"|"examples-and-default-expressions", import('eslint').Linter.Config[]>
* }}
*/
const index = {};
Expand Down Expand Up @@ -705,8 +705,8 @@ export default index;
* }
* ) => import('eslint').Linter.Config)}
*/
/* eslint-enable jsdoc/valid-types -- Bug */
export const jsdoc = function (cfg) {
/* eslint-enable jsdoc/valid-types -- Bug */
/** @type {import('eslint').Linter.Config} */
let outputConfig = {
plugins: {
Expand All @@ -721,7 +721,7 @@ export const jsdoc = function (cfg) {
throw new TypeError('Disallowed config value');
}

outputConfig = index.configs[cfg.config];
outputConfig = /** @type {import('eslint').Linter.Config} */ (index.configs[cfg.config]);
}

if (cfg.rules) {
Expand Down
Loading