SuiteScript 2.1 JSDoc Validation

Note:

If you're still using SuiteScript 2.0, consider updating to SuiteScript 2.1. This also applies to scripts that use the 2.x value for the @NApiVersion JSDoc tag. SuiteScript 2.1 includes new language features from ECMAScript 2023. For more information, see SuiteScript 2.1 and SuiteScript Versioning Guidelines.

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 allows you to 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.

Note:

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

General Notices