jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
9k stars 2.77k forks source link

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

Open Mnigos opened 3 months ago

Mnigos commented 3 months ago

Is there an existing issue for this?

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 commented 2 months ago

any update on this?

ljharb commented 2 months ago

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