jsx-eslint/eslint-plugin-react

[react/jsx-indent] False positive

Open

#3.238 aberto em 8 de mar. de 2022

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (8.630 stars) (2.797 forks)batch import
bughelp wanted

Description

My code was OK until version 7.28.0 but fails with multiple react/jsx-indent errors in versions 7.29.0-3.

Example:

    render(): React.Node {
      const {forwardedRef, isDisabled, key} = this.props;

      return <WrappedComponent
        forwardedRef={forwardedRef}
        isDisabled={isDisabled}
        key={key}
        svgElement={svgElement} />;
    }

Error: ESLint: Expected indentation of 6 space characters but found 8.(react/jsx-indent)

Applying autofix gives me this:

    render(): React.Node {
      const {forwardedRef, isDisabled, key} = this.props;

      return <WrappedComponent
        forwardedRef={forwardedRef}
        isDisabled={isDisabled}
        key={key}
      svgElement={svgElement} />;
    }

which leads to: ESLint: Expected indentation of 8 space characters but found 6.(react/jsx-indent-props)

Guia do colaborador