jsx-eslint/eslint-plugin-react

prefer-stateless-function should not check a .d.ts for a Stateful Component

Open

#2.296 aberto em 31 de mai. de 2019

Ver no GitHub
 (3 comments) (2 reactions) (0 assignees)JavaScript (2.797 forks)batch import
bughelp wantedtypescript

Métricas do repositório

Stars
 (8.630 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Imagine that we have a stateful react component and is about to creating a declaration file d.ts for the .js/.jsx file.

declare class StateCom extends React.Component<Props> {}
export default StateCom;

and error/warning occurs that: Component should be written as a pure function eslint(react/prefer-stateless-function)

How can we handle this since the component is a truly Component with state instead of a functional component?

Guia do colaborador