-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Enable and apply unicorn/no-reduce
#3171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| count += looseParseInt(reaction.textContent!); | ||
| } | ||
|
|
||
| return count; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // If there are no tags in the repository | ||
| if (nodes.length === 0) { | ||
| return tags; | ||
| tags[commit].push(node.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return description | ||
| .split(splittingRegex) | ||
| .reduce(splitTextReducer, new DocumentFragment()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test
Look at this very discussion’s title or a PR list: https://github.com/sindresorhus/refined-github/pulls
| return defaults; | ||
| }, {})); | ||
| return JSON.stringify(getFeatures().map(name => [`feature:${name}`, true])); | ||
| // TODO: unignore after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42036 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test
Visit the Options page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test doesn't pass. Fixing.
Edit: fixed in e226f9d
webpack.config.ts
Outdated
| entries[entry] = `./source/${entry}`; | ||
| return entries; | ||
| }, {}), | ||
| ].map(file => [file, `./source/${file}`])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test
If it compiles, it passes
Follows #3168
With a few exceptions,
.reducedoesn't actually reduce (heh) the amount of code needed.