Skip to content

Commit

Permalink
refactor: further dropping of lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Nov 29, 2021
1 parent 66502df commit ec532f1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/rules/noUndefinedTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
import {
traverse, parse as parseType, tryParse as tryParseType,
} from 'jsdoc-type-pratt-parser';
import _ from 'lodash';
import iterateJsdoc, {
parseComment,
} from '../iterateJsdoc';
Expand Down Expand Up @@ -62,7 +61,7 @@ export default iterateJsdoc(({
});
}

const typedefDeclarations = _(context.getAllComments())
const typedefDeclarations = context.getAllComments()
.filter((comment) => {
return comment.value.startsWith('*');
})
Expand All @@ -76,8 +75,7 @@ export default iterateJsdoc(({
})
.map((tag) => {
return tag.name;
})
.value();
});

const ancestorNodes = [];
let currentScope = scopeManager.acquire(node);
Expand All @@ -90,7 +88,7 @@ export default iterateJsdoc(({
// `currentScope` may be `null` or `Program`, so in such a case,
// we look to present tags instead
let templateTags = ancestorNodes.length ?
_(ancestorNodes).flatMap((ancestorNode) => {
ancestorNodes.flatMap((ancestorNode) => {
const commentNode = getJSDocComment(sourceCode, ancestorNode, settings);
if (!commentNode) {
return [];
Expand All @@ -101,8 +99,7 @@ export default iterateJsdoc(({
return jsdocUtils.filterTags(jsdoc.tags, (tag) => {
return tag.tag === 'template';
});
})
.value() :
}) :
utils.getPresentTags('template');

const classJsdoc = utils.getClassJsdoc();
Expand Down

0 comments on commit ec532f1

Please sign in to comment.