dprint-plugin-typescript
dprint-plugin-typescript copied to clipboard
Automatic Symbol Naming
Consider the following Symbol.
util/nominality/Tag.ts
export const Tag = Symbol.for("my_project/util/nominality/Tag.Tag");
To name this meaningfully, one needs to look at the export junctions. If we later decide to rearrange...
- util/nominality/Tag.ts
+ util/nominality.ts
... we must remember to update the value supplied to for
.
- export const Tag = Symbol.for("my_project/util/nominality/Tag.Tag");
+ export const Tag = Symbol.for("my_project/util/nominality.Tag");
This is very frustrating/easy to forget... enough such that I typically do Symbol.for("TODO")
.
I'm not sure if you'd quality this as "formatting" per se... but I'd absolutely LOVE for DPrint to manage symbol names.
Anyways, just thought I'd share the idea of auto-naming. Thank you for considering :)
I think this is out-of-scope. You can try to create a custom eslint rule :)