Skip to content

fix(deps): bump @sasjs/lint to 4.3.1 - #1496

Merged
allanbowe merged 1 commit into
mainfrom
fix/deps-lint-4-3-1
Oct 25, 2026
Merged

allanbowe merged 1 commit into
mainfrom
fix/deps-lint-4-3-1

Conversation

@sasjs-dev

@sasjs-dev sasjs-dev Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Closes #1481.

Bumps @sasjs/lint from 4.3.0 to 4.3.1 in both places it is declared - the devDependency (the CLI's own specs) and the peerDependency (what a user's project resolves when it runs sasjs lint).

What arrives with 4.3.1 (sasjs/lint#257)

  • Case 1 - a %str-masked invocation was counted as unused. A macro invoked inside %str / %nrstr is now a use, so sasjs lint fix no longer deletes a declaration the file depends on. The masked argument is scanned for %name tokens only, never as code, so a quote or comment marker inside it cannot open a string and swallow the invocations that follow.
  • Case 2 - a mistyped entry tag hid every declaration below it. @il (and @l1, @1i) is read as an entry, so a typo cannot truncate the list, and the formatter writes the tag back as @li. Unrelated tags (@example, @param) end the list and leave the section rewritable.
  • Case 3 - webout. Already covered by ignoredMacros since 4.3.0; unchanged.

4.3.1 also removes <h4> Other Macros </h4> from the reader. It is not a SASjs header section - the compiler's dependency headers are SAS Macros, SAS Includes, Binary Files, Data Inputs and Data Outputs, and the word appears in no file in core, cli, utils, adapter, the extension or server. It entered lint with its own macro rules as an escape hatch, which ignoredMacros covers. A file that listed a macro under that heading now reports it, and the fix points at SAS Macros or ignoredMacros.

Verified through the CLI

On the header from #1481 (@il mf_getvalue.sas plus a %str-masked %psmf_getuserrole()), using this build:

$ sasjs lint find /tmp/cli1481/case2.sas
Warning  Line exceeds maximum length by 1 characters  [18, 1]      <- my fixture line, not a macro

$ sasjs lint fix /tmp/cli1481/case2.sas
... @il mf_getvalue.sas  ->  @li mf_getvalue.sas
    psmf_getuserrole entry kept

Gates: npm run build clean, npm run lint clean, npm audit --omit=dev 0 vulnerabilities, node release/audit.mjs passes on its documented exemptions (3).

Picks up the three false positives reported in #1481, which are fixed in
sasjs/lint#257 and released as 4.3.1:

- a macro invoked inside the argument of `%str` / `%nrstr` now counts as used,
  so `sasjs lint fix` no longer deletes a declaration the file depends on. The
  masked argument is scanned for `%name` tokens only, so a quote or comment
  marker inside it cannot swallow the invocations that follow.
- a mistyped entry tag (`@il`, `@l1`, `@1i`) is read as an entry, so a typo no
  longer hides the declarations below it, and the formatter repairs the tag.
  Unrelated tags (`@example`, `@param`) end the list and leave the section
  rewritable.
- `<h4> Other Macros </h4>` is no longer read. It is not a SASjs header
  section - the compiler's dependency headers are `SAS Macros`, `SAS Includes`,
  `Binary Files`, `Data Inputs` and `Data Outputs` - and `ignoredMacros` is the
  setting for a macro with no file to point at. A file that listed a macro
  there now reports it.

The peer range moves with the devDependency, so a project resolves 4.3.1
through `sasjs lint`. Verified through the CLI itself on the header from #1481:
`sasjs lint find` reports no macro diagnostics, and `sasjs lint fix` writes
`@li mf_getvalue.sas` back while keeping the `%str`-masked `psmf_getuserrole`
entry.

@sasjs-dev sasjs-dev Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed the full diff: @sasjs/lint 4.3.0 -> 4.3.1 bump in package.json plus the matching lockfile entry (devDependency, peer range, resolved/integrity updated). No source changes.

  • package.json:97 - "@sasjs/lint": "^4.3.1" keeps a caret range on a dependency this PR changes, while every other entry in the manifest is pinned exactly and .npmrc sets save-exact=true. Pin to "4.3.1" so a later install cannot silently drift. The peerDependencies entry at package.json:127 can stay ranged - loose peer ranges are the normal convention there.

Hardening passed: .npmrc has ignore-scripts=true and save-exact=true, lockfile is committed and in sync, CI uses npm ci and runs npm audit --omit=dev --audit-level=low as a hard step. This repo releases from semantic-release on main and "fix(deps): ..." is a valid patch-driving subject. Checks were still pending at review time.

1 finding above for review.

@github-actions

Copy link
Copy Markdown

Coverage report

Total coverage

Status Category Percentage Covered / Total
🟡 Statements 78.85% 4608/5844
🟡 Branches 67.39% 1988/2950
🟡 Functions 78.04% 899/1152
🟢 Lines 86.16% 10910/12662

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Show files with reduced coverage 🔻

Reduced coverage

Status Filename Statements Branches Functions Lines
🟢 src/commands/compile/compileSingleFile.ts 95.83% (-2.08% 🔻) 84% (-4% 🔻) 100% 100%

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from c2578d7

@allanbowe
allanbowe merged commit b7c23f9 into main Oct 25, 2026
3 checks passed
@allanbowe
allanbowe deleted the fix/deps-lint-4-3-1 branch October 25, 2026 18:45
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.

False positive lint report

1 participant