NetSuite SuiteScript v1/v2 linting rules for ESLint
Installation per project is highly recommended:
$ npm i -D eslint eslint-plugin-suitescript
Add "suitescript" to the plugins section of your ESLint config file.
"plugins": ["suitescript"]
Enable the rules that you would like to use.
"rules": {
"suitescript/script-type": "error",
"suitescript/no-log-module": "error",
}
Or use a predefined setting for quick setup (choose one).
// All available rules
"extends": ["plugin:suitescript/all"]
// Just the recommended rules
"extends": ["plugin:suitescript/recommended"]
- suitescript/api-version: Enforces valid
@NApiVersion
tag values - suitescript/entry-points: Enforces inclusion of at least one entry point based on
@NScriptType
- suitescript/log-args: Enforces correct log arguments
- suitescript/module-vars: Enforces correct module identifiers for each configured module
- suitescript/no-amd-name: Restricts naming of AMD modules
- suitescript/no-extra-modules: Enforces equal number of module literals and identifiers
- suitescript/no-invalid-modules: Enforces valid SuiteScript modules in
define
array - suitescript/no-log-module: Restricts loading of the N/log module in favor of global
log
- suitescript/no-module-extensions: Restricts filename extensions on module dependencies
- suitescript/script-type: Enforces valid
@NScriptType
tag values
eslint-plugin-suitescript is licensed under the MIT License.