TypeScript

TypeScript is being used as a type checker for JavaScript.

This is a new linter that is being set up and readied for production use. Please discuss with Mark Banner (standard8) before setting up new projects.

Run Locally

The mozlint integration of TypeScript can be run using mach:

$ mach lint --linter typescript <file paths>

Alternatively, omit the --linter typescript and run all configured linters, which will include TypeScript.

TypeScript does not support the --fix option.

See the Usage guide for more options.

Understanding Rules and Errors

  • Only some files are linted, see the configuration for details.

    • By design we do not lint/format reftests nor crashtests as these are specially crafted tests.

Common Issues and How To Solve Them

This code should neither be linted nor formatted

Configuration

Individual components are configured via TypeScript tsconfig.json files in the project directory.

Sources

Builders

Mark Banner (standard8) owns the builders. Questions can also be asked on #lint:mozilla.org on Matrix.

TypeScript task

This is a tier-3 task whilst it is under development. This is hidden from the default view but will report via the code review bot. Issues should be fixed if possible. If uncertain check with the appropriate team.

For test harness issues, file bugs in Developer Infrastructure :: Lint and Formatting.