typescript.rst (2154B)
1 TypeScript 2 ========== 3 4 `TypeScript`__ is being used as a type checker for JavaScript. 5 6 This is a new linter that is being set up and readied for production use. Please 7 see `this page`_ before setting up new projects. 8 9 Run Locally 10 ----------- 11 12 The mozlint integration of TypeScript can be run using mach: 13 14 .. parsed-literal:: 15 16 $ mach lint --linter typescript <file paths> 17 18 Alternatively, omit the ``--linter typescript`` and run all configured linters, which will include 19 TypeScript. 20 21 TypeScript does not support the ``--fix`` option. 22 23 See the `Usage guide`_ for more options. 24 25 Understanding Rules and Errors 26 ------------------------------ 27 28 * Only some files are linted, see the :searchfox:`configuration <tools/lint/typescript.yml>` for details. 29 30 * By design we do not lint/format reftests nor crashtests as these are specially crafted tests. 31 32 Common Issues and How To Solve Them 33 ----------------------------------- 34 35 This code should neither be linted nor formatted 36 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 37 38 * If it is a third-party piece of code, please add it to :searchfox:`ThirdPartyPaths.txt <tools/rewriting/ThirdPartyPaths.txt>`. 39 * If it is a generated file, please add it to :searchfox:`Generated.txt <tools/rewriting/Generated.txt>`. 40 41 Configuration 42 ------------- 43 44 Individual components are configured via TypeScript ``tsconfig.json`` files in the 45 project directory. 46 47 Sources 48 ------- 49 50 * :searchfox:`Configuration (YAML) <tools/lint/typescript.yml>` 51 * :searchfox:`Source <tools/lint/typescript/__init__.py>` 52 53 Builders 54 -------- 55 56 `Mark Banner (standard8) <https://people.mozilla.org/s?query=standard8>`__ owns 57 the builders. Questions can also be asked on #lint:mozilla.org on Matrix. 58 59 TypeScript task 60 ^^^^^^^^^^^^^^^ 61 62 This is a tier-3 task whilst it is under development. This is hidden from the 63 default view but will report via the code review bot. Issues should be fixed if 64 possible. If uncertain check with the appropriate team. 65 66 For test harness issues, file bugs in Developer Infrastructure :: Lint and Formatting. 67 68 69 .. __: https://www.typescriptlang.org/ 70 .. _this page: ../../typescript/index.html 71 .. _Usage guide: ../usage.html