scripts: fix generate-config-doc, handle usage errors#4807
Merged
MaxLeiter merged 1 commit intothelounge:masterfrom Dec 27, 2023
Merged
scripts: fix generate-config-doc, handle usage errors#4807MaxLeiter merged 1 commit intothelounge:masterfrom
MaxLeiter merged 1 commit intothelounge:masterfrom
Conversation
flotwig
commented
Dec 12, 2023
Comment on lines
+32
to
+33
| /** @type {string[]} */ | ||
| const acc = []; |
Contributor
Author
There was a problem hiding this comment.
I don't use JSDoc type annotations for TypeScript often. If there is a way to do this more concisely without separately defining and annotating acc like this, it would be better imo. I didn't/couldn't just convert this file to .ts due to reasons explained in the PR comment.
3a59475 to
6603c1a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When trying to update the docs for #1344 I noticed that the
generate-config-docscript was broken because it was no longer correctly importingserver/log, my guess is it just got missed during TS conversion. I fixed the default import in this PR.This PR also fixes the types in
generate-config-doc.js, which are checked becausecheckJsis enabled intsconfig.json. I did not convert the file to TypeScript because it is not part of the eslint TS config and I was unsure about making changes to the lint setup. The only type change required was markingaccasstring[]instead ofnever[].Since
generate-config-docrequires TS imports, the comments suggesting to usenode ./scripts/...to execute it are wrong. I switched the comments to use anpmscript which runsts-nodefor the user.Additionally, I added a check that the DOC_ROOT_PATH is supplied, so the script exits with a nice error instead of a less useful uncaught exception from
writeFileSync.Running this revealed that some of the existing config docs are out-of-date, so I opened a PR to sync up: thelounge/thelounge.github.io#275