|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| arkanalyzer/ | | 22-Oct-2025 | - | 42,619 | 32,842 |
| bin/ | | 22-Oct-2025 | - | 21 | 3 |
| cookbook_convertor/ | | 22-Oct-2025 | - | 5,231 | 3,703 |
| docs/rules/ | | 22-Oct-2025 | - | 4,205 | 2,538 |
| homecheck/ | | 22-Oct-2025 | - | 14,217 | 11,059 |
| scripts/ | | 22-Oct-2025 | - | 901 | 675 |
| src/ | | 22-Oct-2025 | - | 45,000 | 38,511 |
| stats_calculator/ | | 22-Oct-2025 | - | 296 | 245 |
| test/ | | 22-Oct-2025 | - | 214,007 | 206,741 |
| .editorconfig | D | 22-Oct-2025 | 95 | 7 | 5 |
| .gitignore | D | 22-Oct-2025 | 100 | 8 | 8 |
| .prettierignore | D | 22-Oct-2025 | 740 | 29 | 27 |
| .prettierrc.json | D | 22-Oct-2025 | 180 | 11 | 10 |
| BUILD.gn | D | 22-Oct-2025 | 5.2 KiB | 133 | 126 |
| README.md | D | 22-Oct-2025 | 3.2 KiB | 84 | 50 |
| build_linter.py | D | 22-Oct-2025 | 11 KiB | 292 | 233 |
| compare_branches.py | D | 22-Oct-2025 | 2.8 KiB | 94 | 57 |
| eslint.config.mjs | D | 22-Oct-2025 | 10.9 KiB | 286 | 280 |
| package-lock.json | D | 22-Oct-2025 | 211.8 KiB | 5,658 | 5,657 |
| package.json | D | 22-Oct-2025 | 4 KiB | 87 | 86 |
| test_linter.sh | D | 22-Oct-2025 | 858 | 29 | 10 |
| tsconfig-sdk.json | D | 22-Oct-2025 | 20.3 KiB | 792 | 791 |
| tsconfig.json | D | 22-Oct-2025 | 420 | 20 | 18 |
| tslinter.bat | D | 22-Oct-2025 | 745 | 21 | 17 |
| tslinter.sh | D | 22-Oct-2025 | 834 | 23 | 2 |
| webpack.config.js | D | 22-Oct-2025 | 944 | 35 | 18 |
README.md
1# TypeScript linter
2
3Typescript linter ( further mentioned as 'linter' ) is a tool to check typescript sources and find language elements
4and constructions which are deprecated to use in a purpose to migrate sources to ETS.
5The linter is currently under development.
6
7## Prerequisits
8
9### Visual Studio Code
10
11For development, it's recommended to use `VS Code`, as it has a full built-in support for TypeScript language.
12
13### NodeJS and NPM
14
15Install the latest stable version of `Node` and `NPM`. It is recommended to use a `Node version manager` to install Node and NPM ([nvm](https://github.com/nvm-sh/nvm) for Linux; [nvm-windows](https://github.com/coreybutler/nvm-windows) for windows). You can also follow the [official guide](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
16
17## Building
18
19Run the following command to install project dependencies:
20
21```bash
22npm install
23```
24
25Run the following command to install ohos-typescript:
26
27```bash
28npm run install-ohos-typescript
29```
30
31Run the following command to build project sources:
32
33```bash
34npm run build
35```
36
37## Running
38
39Run the following command from the same directory:
40
41```bash
42node dist/tslinter.js [options] [input files]
43```
44
45Note: Before linting a project, it is highly recommended to install all project dependencies (with `npm install` or any other methods -- depends on the concrete project).
46
47You can also use command files `tslinter.sh` or `tslinter.bat` with same arguments as for direct launch.
48
49Possible command options:
50
51`--deveco-plugin-mode` - this options defines special mode to launch from IDE and should NOT be used when running from command line.
52
53`-f, --project-folder <path>` - defines path to folder with TypeScript sources and subfolders which linter walks recurscevely. This option may be repeated in command line with different paths.
54
55`-p, --project <path>` - defines path to TS project configuration file (commonly known as tsconfig.json). If no input file is defined directly as command-line argument, then all source files from tsconfig.json will be processed by linter. Otherwise, linter will only process input files from command-line, that are included into project (i.e. files that belong to intersection of input files from command-line and tsconfig.json file).
56
57`-E, --TSC_Errors` - enables logging messages about compilation errors and unresolved symbols.
58
59All other command line arguments are considered as paths to TypeScript files.
60
61To prevent command line buffer overflow, response file may be used. It is specified by adding `@` prefix to file name (e.g.: `tslinter.sh @response-file.txt` ). Response file should contain TypeScript source paths (one at each line). The response file argument should be the last command argument (any following argument will be ignored).
62
63## Running tests
64
65To run all tests, use the following command:
66
67```bash
68npm test
69```
70
71To run only certain tests, use the `testrunner` command with corresponding arguments:
72
73```bash
74npm run testrunner -- [args]
75```
76
77E.g., the following command:
78
79```bash
80npm run testrunner -- -d test/main -p {array,object}*
81```
82
83will run the tests in `test/main` directory that match the glob pattern `{array,object}*` (i.e. tests that start with `array` or `object`)
84