Add descriptive names to all Flow object indexer types in MusicBrainz's code
We use a tool called ESLint to find problems in our JavaScript code and ensure it has a consistent style. ESLint is configured to use "rules" which each check for a different problem in the code.
Additionally, we use Flow to add static types to our JavaScript.
This task requires you to fix all problems detected by the flowtype/require-indexer-name ESLint rule.
To invoke this rule and find a list of such problems, you must first navigate to the git checkout of musicbrainz-server in your terminal, and run:
./script/check_eslint_rule 'flowtype/require-indexer-name: [warn, always]' root/
The output will tell you which files it detected problems in, including line numbers, alongside a description of the actual issue on each line.
For this task, you'll need to change object indexers like [string]
or [number]
to have a name describing what the key is; e.g. an object used to look up tags by their name might have an indexer of [tagName: string]
. The tagName:
bit is for documentation purposes only, but helps readers of the code quickly determine how the object is used. Note: generic indexer names like "key:" are usually not descriptive enough to be useful, so you'll have to read the code to pick a good name!
To complete the task, submit a pull request to our GitHub repository with a proper description mentioning the specific rule, and respond to any suggestions and requests by the MusicBrainz developers until the pull request is approved (you do not need to wait until it gets merged).