Skip to content

Commit

Permalink
avoid for of
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Sep 23, 2024
1 parent ee79071 commit 7f7fbd3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/rules/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ function isTypescriptFunctionOverloads(nodes) {

if (nodesArr[0].type === 'ExportDefaultDeclaration') {
let num = 0;
for (const node of nodesArr) {
for (let i = 0; i < nodesArr.length; i++) {
const type = nodesArr[i].declaration.type;
if (
// eslint 6+
node.declaration.type === 'TSDeclareFunction'
type === 'TSDeclareFunction'
// eslint 4-5
|| node.declaration.type === 'TSEmptyBodyFunctionDeclaration'
|| type === 'TSEmptyBodyFunctionDeclaration'
) {
num++;
}
Expand Down

0 comments on commit 7f7fbd3

Please sign in to comment.