eslint-plugin-jsdoc 65.3.1 → 65.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -163,5 +163,5 @@
163
163
  "test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
164
164
  "test-index": "pnpm run test-no-cov test/rules/index.js"
165
165
  },
166
- "version": "65.3.1"
166
+ "version": "65.3.2"
167
167
  }
@@ -1,7 +1,20 @@
1
1
  import iterateJsdoc from '../iterateJsdoc.js';
2
2
 
3
+ /**
4
+ * @param {import('eslint').Rule.Node|null} node
5
+ * @returns {boolean}
6
+ */
7
+ const isAccessor = (node) => {
8
+ const methodNode = node?.type === 'FunctionExpression' ? node.parent : node;
9
+
10
+ return [
11
+ 'get', 'set',
12
+ ].includes(/** @type {{kind?: string}} */ (methodNode)?.kind ?? '');
13
+ };
14
+
3
15
  export default iterateJsdoc(({
4
16
  context,
17
+ node,
5
18
  utils,
6
19
  }) => {
7
20
  const {
@@ -26,6 +39,12 @@ export default iterateJsdoc(({
26
39
  }
27
40
  }
28
41
 
42
+ // A getter or setter has no initializer which a `@default` could repeat;
43
+ // its `@default` documents the default value of the property
44
+ if (isAccessor(node)) {
45
+ return;
46
+ }
47
+
29
48
  const defaultTags = utils.getPresentTags([
30
49
  'default', 'defaultvalue',
31
50
  ]);