diff --git a/packages/base/rules-snapshot.json b/packages/base/rules-snapshot.json index e37c4f1..e301a5a 100644 --- a/packages/base/rules-snapshot.json +++ b/packages/base/rules-snapshot.json @@ -176,7 +176,24 @@ "always", { "tags": { "returns": "never", "template": "always", "throws": "never" } } ], - "jsdoc/require-jsdoc": "error", + "jsdoc/require-jsdoc": [ + "error", + { + "require": { + "ArrowFunctionExpression": true, + "ClassDeclaration": true, + "FunctionDeclaration": true, + "FunctionExpression": true, + "MethodDefinition": true + }, + "contexts": [ + "TSInterfaceDeclaration", + "TSTypeAliasDeclaration", + "TSEnumDeclaration", + "TSPropertySignature" + ] + } + ], "jsdoc/require-param": ["error", { "unnamedRootBase": ["options"] }], "jsdoc/require-param-description": "error", "jsdoc/require-param-name": "error", diff --git a/packages/base/src/index.d.mts b/packages/base/src/index.d.mts index 98df94e..df20e92 100644 --- a/packages/base/src/index.d.mts +++ b/packages/base/src/index.d.mts @@ -11,6 +11,10 @@ declare module '@metamask/eslint-config' { * can only be used with the {@link createConfig} function. */ type ConfigWithExtends = Config & { + /** + * The configuration(s) to extend. This can be a single configuration, an + * array of configurations, or an array of arrays of configurations. + */ extends?: Config | Config[] | Config[][]; }; diff --git a/packages/base/src/index.mjs b/packages/base/src/index.mjs index 9ce28b0..8d6219f 100644 --- a/packages/base/src/index.mjs +++ b/packages/base/src/index.mjs @@ -393,7 +393,24 @@ const rules = createConfig({ 'always', { tags: { returns: 'never', template: 'always', throws: 'never' } }, ], - 'jsdoc/require-jsdoc': 'error', + 'jsdoc/require-jsdoc': [ + 'error', + { + require: { + ArrowFunctionExpression: true, + ClassDeclaration: true, + FunctionDeclaration: true, + FunctionExpression: true, + MethodDefinition: true, + }, + contexts: [ + 'TSInterfaceDeclaration', + 'TSTypeAliasDeclaration', + 'TSEnumDeclaration', + 'TSPropertySignature', + ], + }, + ], 'jsdoc/require-param-name': 'error', 'jsdoc/require-param': ['error', { unnamedRootBase: ['options'] }], 'jsdoc/require-param-description': 'error',