SuiteScript 2.1 JSDoc Validation
Update scripts that use SuiteScript 1.0 or the SuiteScript 2.0 or 2.x version annotations to SuiteScript 2.1 by the 2028.2 release to ensure continued compatibility. For more information, see Transitioning To SuiteScript 2.1.
JSDoc 3 is a documentation generator for JavaScript source code. Developers insert specific comment blocks into their source code, and these comment blocks can be extracted to generate documentation. These comment blocks start with /** and end with */.
JSDoc also includes its own markup language, which is made up of JSDoc tags. These tags are prefaced with the @ symbol. The JSDoc tags are added to the comment blocks and are used to specify the various entities of a JavaScript file (for example, @param).
/**
* Creates a file
* @param {string} name - file name
* @param {string} fileType - file type
* @param {string} contents - file content
* @returns {Object} file.File
*/
JSDoc parses the source code for each comment block. JSDoc 3 also lets you create custom JSDoc tags. These tags can be defined to trigger events (for example, displaying a certain page).
SuiteScript 2.1 includes several custom tags, including @NApiVersion and @NScriptType. Some of these tags are required in each entry point script uploaded to NetSuite. To learn about these tags, see SuiteScript 2.1 JSDoc Tags.
When a SuiteScript 2.1 script record is requested, NetSuite uses JSDoc 3 to evaluate the entry point script and parse the code for the required JSDoc tag. This tag is used to validate the SuiteScript version.
SuiteScript 2.1 users can use JSDoc 3 to create their own documentation for scripts, custom modules, and SuiteApps. To take advantage of this tool, developers must download JSDoc 3 from the official website. For more information about JSDoc 3, see https://jsdoc.app/.
For information about JSDoc validation and tags, see the following topics:
Related Topics
- SuiteScript 2.1
-
SuiteScript Versioning Guidelines