Repository navigation
Replace # private members with _x and forbid # (issue #946) - #951
Merged
Merged
Conversation
- The 11 ECMAScript # members in src/ become _x with a JSDoc @Private tag, matching hed-typescript's private _x. No behavior change. - BidsHedTsvParser._braceRegEx gets a JSDoc block. - datasetParser.spec.js reads BidsFileAccessor._SUFFIXES.length instead of a hardcoded 7, as hed-typescript does. - ESLint no-restricted-syntax rejects PrivateIdentifier (#x). - copilot-instructions.md states the convention. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are blocking approval of the private-member naming changes.
No open issues 🎉
What changed in this PR
Aligns private-member naming in hed-javascript with hed-typescript for issue #946, using underscore-prefixed members and JSDoc annotations instead of ECMAScript private syntax.
Changes:
- Converts 11
#members to underscore-prefixed members with@privateannotations and updates their references. - Adds an ESLint restriction against
#members and documents the convention. - Updates the dataset parser test to derive its expected category count from
_SUFFIXES.
| File | Description |
|---|---|
| tests/otherTests/datasetParser.spec.js | Derives the expected count from _SUFFIXES.length. |
| src/utils/paths.js | Renames the path-organization state field. |
| src/schema/specs.js | Renames the schema specification backing map. |
| src/schema/entries/tag.js | Renames the cached ancestor field. |
| src/parser/reservedChecker.js | Renames the singleton instance field. |
| src/parser/parsedHedTag.js | Renames the normalized-tag field. |
| src/parser/parsedHedGroup.js | Renames the normalized-group cache. |
| src/bids/validator/tsvValidator.js | Renames private methods and the regex field; documents the regex. |
| src/bids/types/file.js | Renames the validator-class backing field. |
| src/bids/datasetParser.js | Renames the static suffix list. |
| eslint.config.mjs | Rejects ECMAScript private identifiers. |
| .github/copilot-instructions.md | Documents underscore naming and @private annotations. |
Review effort: Balanced
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.
Addresses #946.