-
Notifications
You must be signed in to change notification settings - Fork 212
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
Prettier #55
Prettier #55
Conversation
tslint-config-prettier is necessary to make prettier play nice with tslint.
this commit formats src/* and tests/* according to prettier so that it would be a starting point for all commits from now on ( if not done prettier would do it anayway once a change occurs in one of those files, and cloud the actual change made by that commit)
the function keyword makes code more readable when the function's body is large, one tends to lose track while reading large arrow functions.
|
||
img.onerror = errorHandler | ||
img.onabort = errorHandler | ||
img.src = src | ||
}) | ||
} | ||
|
||
export const getCounts = (data: Uint8ClampedArray, ignore: string[]): [] => { | ||
const countMap = {} | ||
export function getCounts(data: Uint8ClampedArray, ignore: string[]): [] { |
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.
@a-hariti What's the thinking behind changing this to a function
?
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.
TLDR it is a matter of preference.
I think it is more readable IMHO, arrow functions are more suitable for one-liners like someNumbers.map(n => n*2)
, but once a functions get as big as this one, it becomes more difficult to keep track of the one you are reading.
this PR adds
prettier
to the build system, formats the codebase accordingly, and suggests some code refactoring, feel free tocherry-pick
.fixes #51