Skip to content

refactor: Implement type-safe configuration using generated string literals#412

Open
Mopsgamer wants to merge 11 commits intonarcisbugeag:mainfrom
Mopsgamer:pure-config
Open

refactor: Implement type-safe configuration using generated string literals#412
Mopsgamer wants to merge 11 commits intonarcisbugeag:mainfrom
Mopsgamer:pure-config

Conversation

@Mopsgamer
Copy link
Contributor

By moving toward string literals and generated types, we eliminate "magic strings" and provide better IDE autocompletion and compile-time validation for our application settings.

@Mopsgamer
Copy link
Contributor Author

I believe this PR makes the configuration migration for #151 more automated and seamless. It's ready for review.

move src/configtype.ts to src/@types/configtypes.d.ts
@Mopsgamer Mopsgamer changed the title refactor: implement type-safe configuration using generated string literals refactor: Implement type-safe configuration using generated string literals Feb 1, 2026
@Mopsgamer Mopsgamer marked this pull request as draft February 15, 2026 12:26
@Mopsgamer Mopsgamer marked this pull request as ready for review February 16, 2026 15:04
const config = getConfig();
const currentState = CONFIG_KEYS.Status.Buttons[currentButton];
const configKeyEnabled =
isGit && state != "Inactive" ? currentState.Git[state].Enabled : currentState[state].Enabled;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using state != "Inactive" here feels strange.


let workspaceExcludedText = "No workspace ignore text provided.";
const ignoreWorkspacesText = config.get(CONFIG_KEYS.Ignore.WorkspacesText)!;
const ignoreWorkspacesText = config.get("vscord.ignore.workspacesText") ?? "";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are multiple uses of !, and it feels buggy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant