Skip to content

Parse static scriptName field #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Parse static scriptName field #37

wants to merge 2 commits into from

Conversation

marklundin
Copy link
Member

@marklundin marklundin commented May 1, 2025

This pull request introduces a minor version update and enhances the functionality of the JSDoc parser to support custom script names. It also includes corresponding updates to test files to validate the new functionality.

Enhancements to JSDoc Parser:

  • src/index.js: Added a new helper function isScriptNameMember to identify static scriptName properties in class declarations. Updated the logic to use the scriptName property as the class name if it exists.

Test Updates:

  • test/fixtures/program.valid.js: Added a static scriptName property to the Example class to test the new functionality.
  • test/tests/valid/program.test.js: Added a new test case to verify the presence and correctness of the customExample script name. Updated an existing test to check for customExample instead of example.

@marklundin marklundin requested a review from Copilot May 1, 2025 08:36
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the JSDoc parser to support custom script names by detecting a static scriptName property, and it also updates the associated test fixtures and test cases accordingly.

  • Introduced a helper function (isScriptNameMember) in src/index.js to identify static scriptName properties.
  • Updated test fixtures and tests to use and validate the new 'customExample' script name.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
src/index.js Adds logic to detect a static scriptName and reassign the class name.
test/fixtures/program.valid.js Updates the script class definition with a new static scriptName property.
test/tests/valid/program.test.js Adds a new test case and updates existing tests to use the custom script name.
Files not reviewed (1)
  • package.json: Language not supported

@marklundin marklundin requested a review from kpal81xd May 1, 2025 11:49
@marklundin marklundin changed the title Feat script name Parse static scriptName field May 1, 2025
@marklundin marklundin requested a review from willeastcott May 2, 2025 20:35
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.

1 participant