Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/cli/htmlhint.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions dist/cli/parse-glob.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 17 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"dependencies": {
"async": "3.2.6",
"commander": "11.1.0",
"commander": "14.0.3",
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

commander is bumped from 11.x to 14.x as part of this change. Since this is a runtime dependency for the published CLI, a major-version upgrade can introduce unrelated breaking behavior; consider either keeping the existing major version (if allowExcessArguments is available there) or splitting the commander upgrade into a dedicated PR with explicit compatibility/testing notes.

Suggested change
"commander": "14.0.3",
"commander": "11.1.0",

Copilot uses AI. Check for mistakes.
"glob": "^13.0.6",
"is-glob": "^4.0.3",
"node-sarif-builder": "4.0.0",
Expand All @@ -74,9 +74,9 @@
"jest": "^30.3.0",
"parse-glob": "3.0.4",
"prettier": "3.8.1",
"rimraf": "^5.0.0",
"rimraf": "^6.1.3",
"rollup": "4.59.1",
"typescript": "5.4.5"
"typescript": "5.9.3"
Comment on lines 76 to +79
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

rimraf and typescript are also bumped as part of the rebuild. These toolchain upgrades can change emitted dist/ output and are not directly required by the CLI behavior change; consider moving these devDependency upgrades into a separate PR to keep the risk/review surface focused.

Copilot uses AI. Check for mistakes.
},
"engines": {
"node": ">=20"
Expand Down
1 change: 1 addition & 0 deletions src/cli/htmlhint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function map(val: string) {
}

const program = new Command()
program.allowExcessArguments(true)
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

This change alters how the CLI tolerates additional positional args, but there’s no regression test covering the new behavior. Please add a CLI-level test (e.g., invoking bin/htmlhint with multiple targets or with additional args after --) that would have previously failed and now succeeds, so the intent is locked in.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While allowExcessArguments(true) works, a more idiomatic approach with commander since v12 is to explicitly declare that your program accepts variadic arguments. This makes the CLI definition clearer.

I suggest removing this line and instead adding .argument('[targets...]', 'file, folder, pattern, stdin, or url to lint') to the command definition chain (e.g., after .usage()).

// src/cli/htmlhint.ts:56
program
  .version(pkg.version)
  .usage('<file|folder|pattern|stdin|url ...> [options]')
  .argument('[targets...]', 'file, folder, pattern, stdin, or url to lint') // Add this line
  .option('-l, --list', 'show all of the rules available')
  // ...

This will have the same effect of allowing multiple file/path arguments, but it is more explicit about the command's interface.


program.on('--help', () => {
console.log(' Examples:')
Expand Down
Loading