Update and refactor glob - #1730
Merged
Merged
Conversation
Replaces deprecated or less preferred glob API usages with updated methods (globSync, globStream) in formatter and htmlhint CLI modules. Removes unused or deprecated options and updates event handling for file matching, improving maintainability and compatibility.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Updates the HTMLHint project to use modern glob API methods, replacing deprecated APIs with globSync and globStream. Also removes unused HTMLHint configuration rules and updates package dependencies to the latest glob version.
- Migrates from deprecated
glob.sync()and callback-basedglob()to modernglobSync()andglobStream() - Removes deprecated glob options (
strict,silent) and updates event handling - Updates glob dependency from v8 to v9 and removes unnecessary type dependencies
Reviewed Changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| website/.htmlhintrc | Removes deprecated HTMLHint rule configurations |
| src/cli/htmlhint.ts | Updates glob imports and replaces deprecated API calls with modern equivalents |
| src/cli/formatter.ts | Updates glob import and removes deprecated options |
| package.json | Upgrades glob dependency to v9 and removes @types/glob |
| silent: true, | ||
| }) | ||
| arrFiles.forEach((file) => { | ||
| arrFiles.forEach((file: string) => { |
There was a problem hiding this comment.
[nitpick] The explicit type annotation string is redundant here. TypeScript can infer the type from globSync() return value, and the original code didn't have this annotation.
Suggested change
| arrFiles.forEach((file: string) => { | |
| arrFiles.forEach((file) => { |
The sourceMappingURL comment at the end of dist/cli/htmlhint.js was updated, likely reflecting a new or rebuilt source map. No other code changes were made.
Deploying htmlhint with
|
| Latest commit: |
90b8929
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d9833ac1.htmlhint.pages.dev |
| Branch Preview URL: | https://dev-coliff-update-glob.htmlhint.pages.dev |
This comment was marked as resolved.
This comment was marked as resolved.
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.
Fixes: Status: #1703
Replaces deprecated or less preferred glob API usages with updated methods (globSync, globStream) in formatter and htmlhint CLI modules. Removes unused or deprecated options and updates event handling for file matching, improving maintainability and compatibility.