fix: preserve comment lines with quotes + modernize deps#1
Merged
Conversation
Fix issue luqmanoop#54: emptyObjProps() now checks __COMMENT_ keys before the # logic, preventing comment text from being truncated when it contains single or double quotes. Two regression tests added. Dependency updates (107 → 9 vulnerabilities, all remaining in dev tools): - meow 5 → 8.1.2 (last CJS release; update flags API with explicit aliases) - TypeScript 3.9 → 5.4 - mocha 6 → 10, ts-node 8 → 10, nyc 14 → 15 - sinon 7 → 17, chai 4.2 → 4.4, nodemon 1 → 3, rimraf 2 → 5 - eslint 5 → 8 with @typescript-eslint plugin; remove babel-eslint - Remove parcel-plugin-shebang (dragged in parcel-bundler v1 CVEs) - Remove coveralls and np (both depend on abandoned request library) - Replace test/mocha.opts with .mocharc.yml (mocha 10 dropped .opts) - Update tsconfig target to ES2020
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.
Bug fix — issue luqmanoop#54
Root cause:
emptyObjProps()inlib/lib.tschecked for#in the value before checking whether the key was a__COMMENT_line. When a comment like# don't use 'production'contained quoted text, the regex/('.*'|".*")/matched it, the value was split on the quotes, and only the trailing fragment was kept — truncating most of the comment.Fix: move the
__COMMENT_guard before the#logic so comment lines are always preserved verbatim.Two regression tests added for both single-quote and double-quote variants.
Dependency modernisation (107 → 9 vulnerabilities)
All remaining 9 vulnerabilities are in dev-only tooling (mocha, nyc, all-contributors-cli) — zero production vulnerabilities.
meowlib/index.tsupdated to use explicit flag aliasestypescriptmochats-nodenycsinonrimrafnodemoneslint@typescript-eslintplugin; removedbabel-eslintprettierparcel-plugin-shebangparcel-bundlerv1 with many CVEs; Parcel v2 handles shebangs natively viatargetsconfigcoverallsrequestlibrary (critical CVE); use GitHub Actions insteadnprequestdependency chain; replacedreleasescript withnpm publishTest plan
npm auditshows 0 production vulnerabilities