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
refactor(statistics) to typescript #1077
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks, looks good!
Just a naming suggestion below
@@ -9,6 +9,24 @@ export type _AuthorType = { | |||
|
|||
}; | |||
|
|||
export interface _EditorType { |
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.
This should be
export interface _EditorType { | |
export type _Editor { |
@@ -19,23 +19,28 @@ | |||
import * as bootstrap from 'react-bootstrap'; | |||
import * as utilsHelper from '../../helpers/utils'; | |||
|
|||
import PropTypes from 'prop-types'; | |||
import {_EditorType} from '../../../types'; |
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.
And with the renaming below:
import {_EditorType} from '../../../types'; | |
import {type Editor} from '../../../types'; |
Problem
The bookbrainz project has been gradually adopting typescript. Typescript can help us prevent the code base more type safe and boost collaboration
Solution
Refactored the statistics and any related functions to typescript.
Added the type _EditorType which can easily be imported in the ts files wherever necessary
Areas of Impact
statistics page