Closed Bug 2088944 Opened 1 month ago Closed 1 month ago

TypeScript check passes for a tsconfig.json with errors, such as an include list that matches no files

Categories

(Developer Infrastructure :: Linting and Formatting: JavaScript, defect)

defect

Tracking

(firefox162 fixed)

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

A tsconfig.json error doesn't fail ./mach ts check or the typescript linter when the project uses the checkRootOnly plugin, as every project does. Both exit 0 and print nothing.

Steps:

  1. Write a tsconfig.json that sets the checkRootOnly plugin and has "include": ["nothing/*.mjs"], or a misspelled option such as "noImplicitAnyy": false.
  2. Run ./mach ts check <dir>.

Expected: error TS18003: No inputs were found in config file, or error TS5025: Unknown compiler option, and exit code 2. That is what happens without the plugin.

Actual: no output, exit code 0.

tools/ts/plugins/checkRootOnly.js builds a new program with ts.createProgram(program.getRootFileNames(), program.getCompilerOptions(), …), which drops the original program's config file diagnostics.

Blocks: 2088790
Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ff1aa08a0090 https://hg.mozilla.org/integration/autoland/rev/f458c0a9547c Keep tsconfig.json errors in the program that the checkRootOnly TypeScript plugin rebuilds. r=frontend-codestyle-reviewers,Standard8
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
Component: Lint and Formatting → Linting and Formatting: JavaScript
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: