Skip to content
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

[Bug]: prefer-read-only-props rule doesn't work with namespaces #3786

Open
2 tasks done
Mnigos opened this issue Jul 20, 2024 · 2 comments
Open
2 tasks done

[Bug]: prefer-read-only-props rule doesn't work with namespaces #3786

Mnigos opened this issue Jul 20, 2024 · 2 comments

Comments

@Mnigos
Copy link

Mnigos commented Jul 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

prefer-read-only-props rule should work with namespace syntax

namespace ItemsListElementSkeleton {
  export interface Props {
    withArtists?: boolean
    withPlayedAt?: boolean
    position?: number
    positionSize?: ItemPosition.Props['size']
    positionClassName?: string
    withPlaysOrPlayTime?: boolean
  }
}

function ItemsListElementSkeleton({
  position,
  positionSize,
  positionClassName,
  withArtists,
  withPlayedAt,
  withPlaysOrPlayTime,
}: ItemsListElementSkeleton.Props) {
...
}

export { ItemsListElementSkeleton }

Should throw an error

Prop '...' should be read-only.

Expected Behavior

Should throw error if props are not readonly

eslint-plugin-react version

v7.35.0

eslint version

v8.57

node version

v20.10.0

@Mnigos
Copy link
Author

Mnigos commented Aug 30, 2024

any update on this?

@ljharb
Copy link
Member

ljharb commented Aug 30, 2024

@Mnigos like everywhere on github, if there were an update, it'd be posted on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants