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 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.

…ents
@ljharb ljharb added the enhancement label Dec 26, 2019
Copy link
Collaborator

ljharb left a comment

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

This comment has been minimized.

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 Jan 2, 2020
@ljharb

This comment has been minimized.

Copy link
Collaborator

ljharb commented Jan 3, 2020

The first option, yes :-)

@ljharb
ljharb approved these changes Jan 3, 2020
@ljharb ljharb force-pushed the RedTn:feat/require-default-props-ignoreFC-option branch from 9b3d08c to 4f3cd90 Jan 3, 2020
@ljharb ljharb merged commit 4f3cd90 into yannickcr:master Jan 3, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 97.542%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.