Skip to content

[explicit-function-return-type] Don't report when using an explicit variable type with an arrow function #149

Closed
@cheezenaan

Description

@cheezenaan

Repro

{
  "extends": ["plugin:@typescript-eslint/recommended"],
  "plugins": ["react"]
}
import * as React from 'react';

interface Props {
    message?: string;
}

export const Hello: React.SFC<Props> = ({ message = 'kiniro-mosaic' }) => (
    <div>{`Hello! ${message}`}</div>;
);

Expected Result

Neither errors nor warnings

Actual Result

7:40  warning  Missing return type on function  @typescript-eslint/explicit-function-return-type

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 1.1.0
@typescript-eslint/parser 1.1.0
eslint-plugin-react 7.12.4
react 16.7.0
react-dom 16.7.0
TypeScript 3.2.4
ESLint 5.12.1
node 8.11.3
npm 5.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions