Skip to content

Feature request: prettier.getFileInfo(path) API and CLI option #4253

@kachkaev

Description

@kachkaev

We were discussing Prettier plugin support in Atom with @robwise and faced the default parser problem.

Until Prettier stops parsing unsupported files as suggested in #2884, its editor extensions need to be fed with a whitelist of supported scopes. Without this list, Prettier would throw an exception when a user presses cmd+s for an unsupported file type or silently fail on real parse errors, which is also undesired. Because #2884 cannot be resolved until Prettier 2.0 and this might take a while, is there any room for a new API call like prettier.isFileSupported(file) and a corresponding CLI option? This feature could be used by the editor extensions before applying format on safe, and as a consequence, save a user from maintaining a whitelist of scopes.

How do you see the exterior of this feature look like? I can help with a PR if it has a potential to land to Prettier < 2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions