Skip to content

Replace # private members with _x and forbid # (issue #946) - #951

Merged
VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:fix_required
Oct 30, 2026
Merged

VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:fix_required

Conversation

@VisLab

@VisLab VisLab commented Oct 30, 2026

Copy link
Copy Markdown
Member
  • 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.

Addresses #946.

- 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>

Copilot AI left a comment

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.

🟢 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 @private annotations 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

@VisLab VisLab added quality Code quality, not must-fix types alignment Alignment between hed-javascript and hed-typescript. labels Oct 30, 2026
@VisLab
VisLab merged commit 7ca247f into hed-standard:main Oct 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alignment Alignment between hed-javascript and hed-typescript. quality Code quality, not must-fix types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants