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

feat(require-default-props): add option to ignore functional components #2532

Merged

Conversation

RedTn
Copy link
Contributor

@RedTn RedTn commented Dec 24, 2019

Addresses the discussion from #1009
Specifically from the recommendation at: #1009 (comment) to 'warn less'.

This PR adds an option to require-default-props to ignore functional components, as react will soon deprecate defaultProps on functional components reactjs/rfcs#107.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add some tests for export function Foo() {} and export const Foo = () => {} and export default function Foo() {}, and let's make sure all these tests run on all the parsers.

docs/rules/require-default-props.md Outdated Show resolved Hide resolved
@RedTn
Copy link
Contributor Author

RedTn commented Jan 2, 2020

Let's also add some tests for export function Foo() {} and export const Foo = () => {} and export default function Foo() {}, and let's make sure all these tests run on all the parsers.

to which rules specifically? these exports tests, all of my new tests, or all tests in this file? i assumed the first option

@RedTn RedTn requested a review from ljharb January 2, 2020 23:16
@ljharb
Copy link
Member

ljharb commented Jan 3, 2020

The first option, yes :-)

@ljharb ljharb force-pushed the feat/require-default-props-ignoreFC-option branch from 9b3d08c to 4f3cd90 Compare January 3, 2020 07:20
@ljharb ljharb merged commit 4f3cd90 into jsx-eslint:master Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants