Skip to content

refactor: configuration class#30

Merged
yCodeTech merged 3 commits intomasterfrom
refactor/configuration
Apr 19, 2026
Merged

refactor: configuration class#30
yCodeTech merged 3 commits intomasterfrom
refactor/configuration

Conversation

@yCodeTech
Copy link
Copy Markdown
Owner

@yCodeTech yCodeTech commented Apr 19, 2026

  • Extracted the logic for determining the appropriate Blade or HTML comment style into a new private method getBladeOrHtmlComments, simplifying the public API and improving clarity. The setBladeComments method now only sets the configuration and no longer returns values based on an onStart flag (the flag was removed in favour using the new private method directly).

  • Replaced repetitive code for adding custom single-line comment languages with a new private method addCustomSingleLineLanguages, reducing duplication and improving maintainability.

  • Replaced var with let for variable declarations in several places to align with modern best practices.

- Extract the "getting" logic in `setBladeComments` method into a new `getBladeOrHtmlComments` method. This removes confusion about what the function does. It was doing too many things. It now adheres to the DOT principle.

    - The `getBladeOrHtmlComments` method now only returns the blade/html comments.

    - The `setBladeComments` method now only sets the comments configuration for the blade language. It also uses the new `getBladeOrHtmlComments`.

- Changed the `setBladeComments` call to use the new `getBladeOrHtmlComments` method in `setLanguageConfiguration`.
…lper

- Refactor the custom single-line language logic in `setSingleLineCommentLanguageDefinitions` method to replace the duplicate loops and logic by a single new helper method: `addCustomSingleLineLanguages`.
@yCodeTech yCodeTech merged commit 9f51a2b into master Apr 19, 2026
1 check passed
@yCodeTech yCodeTech deleted the refactor/configuration branch April 19, 2026 21:51
github-actions Bot added a commit that referenced this pull request Apr 19, 2026
@github-actions github-actions Bot mentioned this pull request Apr 19, 2026
yCodeTech pushed a commit that referenced this pull request Apr 19, 2026
* docs: update changelog for PR #26

* docs: update changelog for PR #29

* docs: update changelog for PR #30

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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