Rule 1.7
On this page

Rule 1.7

Chapter 1, Introduction Test

Every form the surface takes beyond TypeScript must be one the language service can give TypeScript’s checker so that the checker serves the editor (Rule 12.7): projected to valid TypeScript, or kept as a form TypeScript parses, whose grammar report the language service drops and whose content it checks with the compiler’s own check of that form (a stage attribute, Rule 8.1, or @workgroup_size, Rule 8.22). This is the language service’s work: the source is not required to be valid TypeScript, and no TypeScript tool’s acceptance of the source is a criterion (Rule 1.8). A form neither path can carry is not added.

The rule text and the parts under it are the compiler's own English, as the design document writes them.

Rationale

as the language borrows TypeScript’s forms and extends a few (Array<T, N>, the stage attributes), the language service keeps TypeScript’s checker only while every extension has a TypeScript form it can be read as, projected or kept as TypeScript parses it. A checker of TypeShade’s own would be a second implementation of the language; calling the compiler’s own check of a kept form is not one.

Derives from

changes/0100-typescript-meaning.md (section 2, decision D8); change 0130; change 0137.

How it is verified

Checked by a test. A test, a gate script or a CI workflow names this rule, and the traceability check fails when a file listed below stops naming it.

Where the rule says the compiler enforces it:

review; for the forms on the surface today, the parity tests Rule 12.7 names.

The files that verify it at commit af54ddad5, each at the first line that names the rule:

See also

Source

The rule at commit af54ddad5:

Edit this page Report a problem