utils / helpers module
utils / helpers module. A new grab-bag module. Code here has no home, so nobody can find it.
This is how the comment reads inline, under the flagged line.
Why it matters
utils.ts grows forever because anything can go there. Names by topic (dates.ts, money.py) keep code findable and cohesive.
What to do
Name the module by what it's about, or put each helper next to its only caller.
Examples
src/utils.ts
src/dates.ts
What it catches
It reads the shape of the code: functions, blocks, loops and calls. Languages: TypeScript and JavaScript, Python. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.
Flagged
src/utils.ts
export const a = 1;
Left alone
src/dates.ts
export const a = 1;
Research
New `utils`, `helpers` or `common` modules. Code with no home is hard to find, and the module turns into a dependency hub.
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"junk-drawer-module"
],
"severity": {
"junk-drawer-module": "medium"
}
}
}