JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.2p0 | CONFIDENTIAL | CodeSecure Inc |
This page describes the CodeSonar warning classes that are assigned to TypeScript warnings imported from a SARIF file produced by ESLint with typescript-eslint.
For JavaScript warnings, see JavaScript Warning Classes Corresponding to ESLint Rules.
See also the table of CodeSonar warning classes that are supported for all languages. If these classes are enabled, the corresponding CodeSonar checks will include all TypeScript source files that were imported into the project with codesonar es_scan.py, codesonar import_sarif.py, or codesonar add_source_files.py.
This page describes the CodeSonar warning classes that are assigned to warnings imported from a SARIF file produced by ESLint.
For information on setting up your CodeSonar project to incorporate TypeScript source code and the corresponding ESLint results, see Including JavaScript and TypeScript Components in a CodeSonar Project.
When CodeSonar imports a SARIF file, it determines a corresponding CodeSonar warning class for each rule object in the SARIF rules. If a given warning class does not already exist, the SARIF importer creates it.
There is special handling for SARIF files produced by ESLint, including special handling for any typescript-eslint rules in those files.
| CodeSonar Warning Property | Value |
|---|---|
| Name |
Generated from the id property
of the rule object.
The general form of the id is @typescript-eslint/rule_identifier. The CodeSonar warning class name is generated from this id as follows.
|
| Categories |
When a warning class is based on a typescript-eslint rule, its
categories depend on whether the warning class is built in to
CodeSonar or created by the SARIF importer.
|
| otherwise | Other warning class properties are not set by the SARIF importer. |
Suppose the imported SARIF file includes rule objects like the following.
# ... "rules":[ # ... { "id": "no-empty", # ... }, { "id": "@typescript-eslint/no-unused-vars", # ... }, # ... ], # ...
CodeSonar identifies the first of these rules ("id": "no-empty") as originating from a built-in ESLint rule, and handles it as described for JavaScript Warning Classes Corresponding to ESLint Rules.
The id for the second rule
("id":
"@typescript-eslint/no-unused-vars") starts with
@typescript-eslint/, so CodeSonar
identifies it as originating from a typescript-eslint rule.
(It corresponds to the typescript-eslint no-unused-vars rule.)
CodeSonar will consider a SARIF file to be produced by ESLint in the following cases.
Within a SARIF file produced by ESLint, CodeSonar will determine
an individual result to be produced by typescript-eslint if its
id begins with @typescript-eslint/.
(For other warnings in ESLint SARIF, see JavaScript Warning Classes Corresponding to
ESLint Rules.)
These warning classes correspond to rules from typescript-eslint version v7.0.2.
You have multiple degrees of control over reporting for the warnings issued by ESLint, including when it is used with typescript-eslint.
See the ESLint documentation for details: Configure ESLint .
You can also specify a combination of WARNING_FILTER discard and WARNING_FILTER allow rules, if that is the most convenient way to characterize a specific set. When you specify warning class names (or parts of names) in your WARNING_FILTER rules, make sure you are using the generated CodeSonar warning class name as described above.
To report problems with this documentation, please visit https://support.codesecure.com/.