Skip to content

Allow to specify npm-dependencies using json file #1479

@simschla

Description

@simschla

(From discussion in #1453)
For npm-based formatters, one can supply npm-modules to be used:

prettier([ 'my-custom-module': '1.0.0', 'my-second-custom-module': '0.2.0'])

It would be nice to be able to create that list using npm itself e.g. using

echo "$(npm info --json "my-custom-module@latest" peerDependencies) $(npm info --json "my-second-custom-module" peerDependencies)" | jq -s add > dependencies.json

and then use that file as input

prettier().usePeerDependenciesFrom('dependencies.json')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions