Kwjsspec

The kwjsspec command creates a JavaScript build specification based on the arguments you pass to it.

Prerequisites

Before you can create a build specification, you need to install the Server package. See Installing Klocwork.

For more information, see Creating a JavaScript build specification.

Usage

kwjsspec <options>

where <options> are any arguments required for your build.

You can also specify a 'kwjsspec.out' option file:

kwjsspec @kwjsspec.opt

where 'kwjsspec.opt' is a file containing the arguments in separate lines. Below is an example of a kwjsspec.opt file:

--ecma-version
12
--framework
vue
--environment
node
--babel

Options

Name (and short name) Description
--help (-h) display help
--version display kwjsspec version
--output <file> (-o) write the build specification to <file>. By default, the build specification is written to kwjsspec.out in the current working directory.
--ecma-version <integer> (-v) set the ECMA version; The default is version 12.
--use-modules (-m) specify JavaScript modules used by your project; If your project uses the JavaScript modules, include this option.
--framework <string> (-w) Select the framework you would like to use. Use --list-frameworks to view a list of supported frameworks. If your project uses one of the listed frameworks, include this option.
--typescript (-t) specify this option if your project uses TypeScript
--babel (-b) specify this option if your project uses Babel
--environment <string> (-e) add global variables based on your specific environment. Use --list-environments to view a list of supported environments.
--global-return (-g) allows return statements in the global scope. If your project has return statements in the global scope, include this option
--strict enable global strict mode if ecma-version is greater than 5.
--jsx enable JSX. If you have JSX present in your project, include this option.
--ignore <string> (-i) add global patterns to ignore files or folders that should not be analyzed
--ignores-file <string> (-x) specify a file that includes a list of all files or folders that should not be analyzed
--list-environments outputs a list of the supported environments
--list-frameworks outputs a list of the supported frameworks