Skip to content

Commit 2d84367

Browse files
JoshuaKGoldbergbrettz9
authored andcommitted
Corrected output for clearing tags
1 parent 667753a commit 2d84367

File tree

3 files changed

+38
-27
lines changed

3 files changed

+38
-27
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4594,6 +4594,13 @@ let a;
45944594
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]
45954595
// Message: '@abstract' is generally redundant outside of `declare` contexts when using a type system.
45964596

4597+
const a = {
4598+
/** @abstract */
4599+
b: true,
4600+
};
4601+
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]
4602+
// Message: '@abstract' is generally redundant outside of `declare` contexts when using a type system.
4603+
45974604
/** @template */
45984605
let a;
45994606
// "jsdoc/check-tag-names": ["error"|"warn", {"typed":true}]

src/iterateJsdoc.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ const getUtils = (
137137
const replacement = utils.stringify(jsdoc, specRewire);
138138

139139
if (!replacement) {
140-
return fixer.removeRange([
141-
0, jsdocNode.range[1],
142-
]);
140+
return fixer.removeRange(jsdocNode.range);
143141
}
144142

145143
return fixer.replaceText(jsdocNode, replacement);

test/rules/assertions/checkTagNames.js

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default {
4141
},
4242
],
4343
output: `
44+
4445
let a;
4546
`,
4647
},
@@ -108,33 +109,35 @@ export default {
108109
},
109110
],
110111
output: `
112+
111113
let a;
112114
`,
113115
},
114-
// {
115-
// code: `
116-
// const a = {
117-
// /** @abstract */
118-
// b: true,
119-
// };
120-
// `,
121-
// errors: [
122-
// {
123-
// line: 3,
124-
// message: '\'@abstract\' is generally redundant outside of `declare` contexts when using a type system.',
125-
// },
126-
// ],
127-
// options: [
128-
// {
129-
// typed: true,
130-
// },
131-
// ],
132-
// output: `
133-
// const a = {
134-
// b: true,
135-
// };
136-
// `,
137-
// },
116+
{
117+
code: `
118+
const a = {
119+
/** @abstract */
120+
b: true,
121+
};
122+
`,
123+
errors: [
124+
{
125+
line: 3,
126+
message: '\'@abstract\' is generally redundant outside of `declare` contexts when using a type system.',
127+
},
128+
],
129+
options: [
130+
{
131+
typed: true,
132+
},
133+
],
134+
output: `
135+
const a = {
136+
137+
b: true,
138+
};
139+
`,
140+
},
138141
{
139142
code: `
140143
/** @template */
@@ -152,6 +155,7 @@ export default {
152155
},
153156
],
154157
output: `
158+
155159
let a;
156160
`,
157161
},
@@ -200,6 +204,7 @@ export default {
200204
},
201205
],
202206
output: `
207+
203208
function takesOne(param) {}
204209
`,
205210
},
@@ -220,6 +225,7 @@ export default {
220225
},
221226
],
222227
output: `
228+
223229
function takesOne(param) {}
224230
`,
225231
},

0 commit comments

Comments
 (0)