The IDE performs real-time static code check on the JavaScript, UX, and manifest.json files by second.
When a quick app project is opened, full check is triggered for the project source code. The check results of all files are displayed in the PROBLEMS panel.
If a source code file has been added or modified, real-time check is triggered and only the check result of the specific file is updated. If a source code file has been deleted, the check result of the deleted file is deleted in real time.
Critical errors are marked with red wavy lines, and warning errors are marked with green wavy lines.
When you move the cursor to an error, the detailed error information and handling suggestions are displayed. The PROBLEMS panel displays the errors of all the files that are opened (including the file information, number of errors, error information, row number, and column number).
In the PROBLEMS panel, double-click an error to open the file where the error occurs and move the cursor to the error position to view detailed information.

Element | Item |
|---|---|
import | Cross-package dependencies. An error is reported in the following scenarios: ● A primary package depends on its subpackage. ● A subpackage depends on another subpackage. |
template | File root node element (quantity and validity) |
Standard element support | |
A template element can contain only one root node and the root node cannot be a block. | |
Element relationship (parent element and subelements). Currently, the following elements support specific parent elements: span, list-item, tab-bar, tab-content, and option. | |
Number of subelements | |
Whether element attributes can be checked | |
Mandatory element attributes | |
Element attribute value validity | |
Whether an element attribute is empty (warning) | |
Default element attribute value (suggestion) | |
Whether the element inline style is supported | |
Element inline style value validity (including empty value check) | |
Default value of an element inline style (warning) | |
Whether an element tag is closed (the UX element supports automatic closing and symmetric closing) | |
Capitalization of an element tag name (warning) | |
Element ID uniqueness | |
Element attribute uniqueness | |
Whether an element event method has been defined | |
style | Style format |
Whether a style is supported | |
Style value validity (including empty value check) | |
Default style value (warning) | |
script | Data object validity (Only data, props, public, protected, private, and propsDefault are supported.) |
Quick App API support or API parameters | |
Element method |
ux | Element that cannot be used in a card |
Style that cannot be used in a card | |
API that cannot be used in a card (public APIs and other APIs defined by app.ux). | |
Local image resource file that cannot be referenced in a card | |
Global object prototype that cannot be operated in a card |
manifest.json | Mandatory and valid fields |
Field value type | |
Default value alarm |
The open-source tool JSHint is used to quickly check the source code of the script module in the JavaScript and UX files in a quick app project in real time.
If the .jshintrc file does not exist in the root directory of your quick app project, the following default check items are used. You can create a .jshintrc file in the root directory and configure required check items.
For details about the check items, please refer to JSHint Options.
"esversion": 6, // Indicates that your code supports ECMAScript 6 specific syntax. "node": true, // Indicates that the environment is Node.js and global variables including console and require can be used. "strict": false, // Indicates that quick apps do not use the strict mode of ES5 syntax. "bitwise": true, // Indicates that bitwise operators (including ^ and &) cannot be used. "curly": true, // Indicates that curly brackets must be used for if and while statements. "eqequeq": true, // Indicates that == and != must be replaced by === and !== respectively. "freeze": true, // Indicates that the prototypes of native objects (including Array and Date) cannot be overwritten. "immed": true, // Indicates that the immediate function can be used. The expression is the result of a function, not the function itself. "latedef": 'nofunc', // Indicates that a variable cannot be used before it is defined and the function declarations will be ignored. "noarg": true, // Indicates that arguments.caller and arguments.callee cannot be used. "noempty": true, // Indicates that empty code blocks are not allowed. "nocomma": true, // Indicates that comma operators are not allowed. If misused, a comma operator may obscure the value of a statement and promote incorrect code. "nonew": true, // Indicates that constructor functions cannot be used. "undef": true, // Indicates that variables that have not been defined in the global variable list cannot be used. "unused": 'vars', // Indicates that variables cannot be defined but not used. "asi": true, // Indicates that semicolons can be omitted. "laxbreak": true, // Indicates that unsafe line breakings are allowed. Use this option together with laxcomma. "laxcomma": true, // Indicates that the comma-first coding style is allowed. "multistr": true, // Indicates that multi-line strings are allowed. "sub": true, // Indicates that the [] notation is allowed when it can be expressed in dot notation. For example, you can use both person['name'] and person.name. "expr": true // Indicates that an expression can be used when assigning a value or calling a function.
If the .jshintignore file does not exist in the root directory of your quick app project, the following default regular expression is used. You can create a .jshintignore file in the root directory and configure the information about the files or directories that do not need to be checked. The regular expression is the same as that of the .gitignore file. For details about the regular expression in the .gitignore file, please refer to gitignore Documentation.
'**/build/**', '**/node_modules/**'
In addition to the common check items, JSHint triggers real-time and full checks when the .jshintrc and .jshintignore files are added, modified, or deleted.