Skip to content

Improve troubleshooting exerience for bad configs in VSCode settings.json #793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BinToss opened this issue Feb 25, 2025 · 0 comments · May be fixed by #794
Open

Improve troubleshooting exerience for bad configs in VSCode settings.json #793

BinToss opened this issue Feb 25, 2025 · 0 comments · May be fixed by #794

Comments

@BinToss
Copy link
Contributor

BinToss commented Feb 25, 2025

After staying up all night, I traced it to a bad configuration in VSCode User settings.json. Why it was like that, I don't know. Feel free to close this issue if this is out of scope. Otherwise, I'll finish the PR that checks if extends is a string or array, moves it to the correct part of the config object, and removes it from extendsRules.

{
    "commitlint.config.extend.rules": {
        "extends": "@commitlint/config-conventional"
    },
}

RangeError: Found rules without implementation: extends.
Supported rules are: body-case, body-empty, body-full-stop, body-leading-blank, body-max-length, body-max-line-length, body-min-length, footer-empty, footer-leading-blank, footer-max-length, footer-max-line-length, footer-min-length, header-case, header-full-stop, header-max-length, header-min-length, header-trim, references-empty, scope-case, scope-empty, scope-enum, scope-max-length, scope-min-length, signed-off-by, subject-case, subject-empty, subject-full-stop, subject-max-length, subject-min-length, subject-exclamation-mark, trailer-exists, type-case, type-empty, type-enum, type-max-length, type-min-length.
    at lint (file:///c:/Repos/HaloSPV3/hce.shared-config/node_modules/@commitlint/lint/lib/lint.js:48:15)
    at async lint (c:\Repos\BinToss\joshbulduc.vscode-commitlint\dist\worker\index.js:213:22)
    at async handleAsync (c:\Repos\BinToss\joshbulduc.vscode-commitlint\dist\worker\index.js:238:22)

This seems to be caused by an extends property in the IPC message....
Image

...which is later spread inside the commitlint config object's rules property.

Image

BinToss added a commit to BinToss/joshbolduc.vscode-commitlint that referenced this issue Feb 26, 2025
…int.config.extend.rules

fixes joshbolduc#793

This gracefully handles invalid configurations set via the extension's configuration. Previously, commitlint's Lint function would throw an error if our extendRules contained rules that do not satisfy commitlint's
`AnyRuleConfig<RuleConfigQuality.Qualified>`.
@BinToss BinToss changed the title RangeError: Found rules without implementation: extends. Improve troubleshooting exerience for bad configs in VSCode settings.json Feb 28, 2025
BinToss added a commit to BinToss/joshbolduc.vscode-commitlint that referenced this issue Mar 7, 2025
…xtendsRules

First, lint without `extendsRules` to validate loaded config. Void successful result. Repeat with `extendsRules`. Assign second call's successful result.

Commitlint's API does not provide a better solution...

Resolves joshbolduc#793
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 a pull request may close this issue.

1 participant