Skip to content

feat(no-sync)!: move ts-declaration-location to peerDependencies #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

risantos
Copy link

@risantos risantos commented Jun 26, 2025

Description

  • Move ts-declaration-location from dependencies to devDependencies and peerDependencies, declaring it as optional on peerDependenciesMeta, which has typescript as a peer dependency.
    As ts-declaration-location is already tentatively loaded for n/no-sync, the plugin keeps working as expected, throwing with a message identifying the missing package in case it'd be needed while trying to use the ignores option with a non-string value.
  • Update the n/no-sync documentation to refer the updated peer dependency requirement.
  • Update n/no-sync rule to conditionally require ts-declaration-location only when advanced ignores are used.

Note

Set as feat as this should be at least a minor bump, as it may break a lint build.

Related issues

  • Warning received while installing eslint-plugin-n on JS projects without typescript:

    warning "eslint-plugin-n > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
    warning "eslint-plugin-n > [email protected]" has unmet peer dependency "typescript@>=4.0.0".
    warning "eslint-plugin-n > @typescript-eslint/utils > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
    warning "eslint-plugin-n > @typescript-eslint/utils > @typescript-eslint/typescript-estree > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
    warning "eslint-plugin-n > @typescript-eslint/utils > @typescript-eslint/typescript-estree > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
    warning "eslint-plugin-n > @typescript-eslint/utils > @typescript-eslint/typescript-estree > [email protected]" has unmet peer dependency "typescript@>=4.8.4".
  • chore(no-sync): remove @typescript-eslint/utils #449 addressed @typescript-eslint/utils.

@risantos risantos force-pushed the feat/no-sync/optional-ts-declaration-location branch 2 times, most recently from 271865c to 02db95b Compare June 26, 2025 11:54
Copy link

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to move the require(), so it is loaded only when the option is configured?

Copy link
Member

@MichaelDeBoey MichaelDeBoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a breaking change for people using the ignores option of the no-sync rule

@MichaelDeBoey MichaelDeBoey changed the title feat(no-sync): move ts-declaration-location to peerDependencies feat(no-sync)!: move ts-declaration-location to peerDependencies Jun 26, 2025
@aladdin-add
Copy link

the option was introduced in a minor (https://github.com/eslint-community/eslint-plugin-n/releases/tag/v17.19.0), but it unexpectedly introduced ts requirement.

so technically it can be a bugfix?

@risantos
Copy link
Author

@aladdin-add

is it possible to move the require(), so it is loaded only when the option is configured?

Yeah, moved below with a check for the existence of non-string option.ignores.


@MichaelDeBoey

This would be a breaking change for people using the ignores option of the no-sync rule

Likely so, I had read it as minor, given it "might break your lint build", being specific to TS users using n/no-sync with advanced ignores.

However, as I have no data/visibility over how this is used, "likely to break your lint build" also applies.


@aladdin-add

so technically it can be a bugfix?

I could see it working as such having been introduced 24d ago, although if someone's using it, it'd throw. Solvable by adding ts-declaration-location, but still "breaking".

- Set `ts-declaration-location` as an optional peer dependency for the `n/no-sync` rule.
- Move `ts-declaration-location` to `devDependencies` for development and testing.
- Update the `n/no-sync` documentation to refer the updated peer dependency requirement.
- Update `n/no-sync` rule to conditionally require `ts-declaration-location` only when advanced ignores are used.
@risantos risantos force-pushed the feat/no-sync/optional-ts-declaration-location branch from 02db95b to eeb4127 Compare June 26, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants