Skip to content

Commit e4e63a6

Browse files
authored
Merge pull request #279 from golopot/simplify-report
chore: simplify report()
2 parents 0f54957 + 39a15f9 commit e4e63a6

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/iterateJsdoc.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export default (iterator, opts = {}) => {
329329

330330
const jsdoc = parseComment(jsdocNode, indent);
331331

332-
const report = (message, fixer = null, jsdocLoc = null, data = null) => {
332+
const report = (message, fix = null, jsdocLoc = null, data = null) => {
333333
let loc;
334334

335335
if (jsdocLoc) {
@@ -346,22 +346,14 @@ export default (iterator, opts = {}) => {
346346
loc.start.column = colNumber;
347347
}
348348
}
349-
if (fixer === null) {
350-
context.report({
351-
data,
352-
loc,
353-
message,
354-
node: jsdocNode
355-
});
356-
} else {
357-
context.report({
358-
data,
359-
fix: fixer,
360-
loc,
361-
message,
362-
node: jsdocNode
363-
});
364-
}
349+
350+
context.report({
351+
data,
352+
fix,
353+
loc,
354+
message,
355+
node: jsdocNode
356+
});
365357
};
366358

367359
const utils = curryUtils(

0 commit comments

Comments
 (0)