Skip to content

Commit ede2494

Browse files
JoshuaKGoldbergbrettz9
authored andcommitted
Remove no-types overlap
1 parent 249a55b commit ede2494

File tree

3 files changed

+0
-139
lines changed

3 files changed

+0
-139
lines changed

README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4628,29 +4628,6 @@ let a;
46284628
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]
46294629
// Message: '@template' without a name is redundant when using a type system.
46304630

4631-
/** @param {string} */
4632-
function takesOne(param) {}
4633-
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]
4634-
// Message: '@param' without a description is redundant when using a type system.
4635-
4636-
/** @param {boolean} param */
4637-
function takesOne(param) {}
4638-
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]
4639-
// Message: '@param' without a description is redundant when using a type system.
4640-
4641-
/**
4642-
* Existing comment
4643-
* @param {boolean} param
4644-
*/
4645-
function takesOne(param) {}
4646-
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]
4647-
// Message: '@param' without a description is redundant when using a type system.
4648-
4649-
/** @param {boolean} param - takes description */
4650-
function takesOne(param) {}
4651-
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]
4652-
// Message: Describing the type of '@param' is redundant when using a type system.
4653-
46544631
/** @typoo {string} */
46554632
let a;
46564633
// Message: Invalid JSDoc tag name "typoo".

src/rules/checkTagNames.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ const typedTagsUnnecessaryOutsideDeclare = new Set([
5656
'this',
5757
]);
5858

59-
const typedTagsParamReturn = new Set([
60-
'param',
61-
'parameter',
62-
'return',
63-
'returns',
64-
]);
65-
6659
export default iterateJsdoc(({
6760
sourceCode,
6861
jsdoc,
@@ -152,24 +145,6 @@ export default iterateJsdoc(({
152145
}, true);
153146
};
154147

155-
const tagRedundantlyChecksParamOrReturnTyped = (jsdocTag, tagIndex) => {
156-
if (!typedTagsParamReturn.has(jsdocTag.tag)) {
157-
return false;
158-
}
159-
160-
if (!jsdocTag.description.trim()) {
161-
reportWithTypeRemovalFixer(`'@${jsdocTag.tag}' without a description is redundant when using a type system.`, jsdocTag, tagIndex);
162-
return true;
163-
}
164-
165-
if (jsdocTag.type) {
166-
reportWithTypeRemovalFixer(`Describing the type of '@${jsdocTag.tag}' is redundant when using a type system.`, jsdocTag, tagIndex);
167-
return true;
168-
}
169-
170-
return false;
171-
};
172-
173148
const checkTagForTypedValidity = (jsdocTag, tagIndex) => {
174149
if (typedTagsAlwaysUnnecessary.has(jsdocTag.tag)) {
175150
reportWithTypeRemovalFixer(`'@${jsdocTag.tag}' is redundant when using a type system.`, jsdocTag, tagIndex, {
@@ -189,10 +164,6 @@ export default iterateJsdoc(({
189164
return true;
190165
}
191166

192-
if (tagRedundantlyChecksParamOrReturnTyped(jsdocTag, tagIndex)) {
193-
return true;
194-
}
195-
196167
return false;
197168
};
198169

test/rules/assertions/checkTagNames.js

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -235,93 +235,6 @@ export default {
235235
let a;
236236
`,
237237
},
238-
{
239-
code: `
240-
/** @param {string} */
241-
function takesOne(param) {}
242-
`,
243-
errors: [
244-
{
245-
line: 2,
246-
message: '\'@param\' without a description is redundant when using a type system.',
247-
},
248-
],
249-
options: [
250-
{
251-
typed: true,
252-
},
253-
],
254-
output: `
255-
function takesOne(param) {}
256-
`,
257-
},
258-
{
259-
code: `
260-
/** @param {boolean} param */
261-
function takesOne(param) {}
262-
`,
263-
errors: [
264-
{
265-
line: 2,
266-
message: '\'@param\' without a description is redundant when using a type system.',
267-
},
268-
],
269-
options: [
270-
{
271-
typed: true,
272-
},
273-
],
274-
output: `
275-
function takesOne(param) {}
276-
`,
277-
},
278-
{
279-
code: `
280-
/**
281-
* Existing comment
282-
* @param {boolean} param
283-
*/
284-
function takesOne(param) {}
285-
`,
286-
errors: [
287-
{
288-
line: 4,
289-
message: '\'@param\' without a description is redundant when using a type system.',
290-
},
291-
],
292-
options: [
293-
{
294-
typed: true,
295-
},
296-
],
297-
output: `
298-
/**
299-
* Existing comment
300-
*/
301-
function takesOne(param) {}
302-
`,
303-
},
304-
{
305-
code: `
306-
/** @param {boolean} param - takes description */
307-
function takesOne(param) {}
308-
`,
309-
errors: [
310-
{
311-
line: 2,
312-
message: 'Describing the type of \'@param\' is redundant when using a type system.',
313-
},
314-
],
315-
options: [
316-
{
317-
typed: true,
318-
},
319-
],
320-
output: `
321-
/** @param param - takes description */
322-
function takesOne(param) {}
323-
`,
324-
},
325238
{
326239
code: `
327240
/** @typoo {string} */

0 commit comments

Comments
 (0)