Skip to content

package.json diagnostics in --module nodenext #46861

Open
@andrewbranch

Description

@andrewbranch

In #46334, it became clear that it’s very easy to mess up writing export maps that will work correctly with --module nodenext. We would like to explore issuing diagnostics in package.json files in two scenarios (only in node12 and nodenext):

  • A types condition is not the first condition in an export map
  • A default condition is not the last condition in an export map

VS Code currently doesn’t synchronize unsaved changes to package.json files to TS Server (same as tsconfig.json files), so sending errors to the editor can only be done after a manual save. After getting the diagnostics in tsc, we’ll have to evaluate whether the experience in the editor is acceptable, or if we need to start syncing live changes to TS Server.

Metadata

Metadata

Assignees

Labels

Domain: ES ModulesThe issue relates to import/export style module behaviorIn DiscussionNot yet reached consensusRescheduledThis issue was previously scheduled to an earlier milestoneSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions