Skip to content

Configure svelte as an optional peer dependency #279

Closed
@theurgi

Description

@theurgi

Description

Does it make sense to mark svelte as an optional peer dependency as it is for eslint-plugin-svelte?

I have an eslint config that conditionally depends on svelte and its plugins, so in some cases it's not installed. However, I can't seem to suppress pnpm's missing peer deps warning with any configuration on my end.

I assume that pnpm's output indicates that the warning is propagating upwards from svelte-eslint-parser:

 WARN  Issues with peer dependencies found
.
└─┬ @theurgi/eslint-config 1.3.0
  ├── ✕ missing peer svelte@"*"
  └─┬ eslint-plugin-svelte 2.18.0
    ├── ✕ missing peer svelte@^3.37.0
    └─┬ svelte-eslint-parser 0.23.0
      └── ✕ missing peer svelte@^3.37.0
Peer dependencies that should be installed:
  svelte@">=3.37.0 <4.0.0"

In my package: @theurgi/eslint-config, I have svelte set as optional:

"peerDependenciesMeta": {
  "svelte": {
    "optional": true
 },

But this does not silence the warning when using pnpm. Any package that depends on my shareable config inherits this warning.

Interestingly, I get no warning when installing with npm. I haven't tried yarn.

Thank you 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions