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

Parse explicit declaration that class extends React.Component #513

Merged

Conversation

gausie
Copy link
Contributor

@gausie gausie commented Mar 24, 2016

This small addition enables linting component-specific rules if the author uses a JSDoc explicitly indicating that the component is a descendent of React.Component

e.g.

/** @extends React.Component */
class MyClass extends ChildClass {
...

Provides a good workaround for issues such as #68

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 97.005% when pulling 51fde3c on gausie:feature/explicit-react-component-parent into e3c27f9 on yannickcr:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.057% when pulling f3e634c on gausie:feature/explicit-react-component-parent into e3c27f9 on yannickcr:master.

@@ -25,6 +25,7 @@
"devDependencies": {
"babel-eslint": "6.0.0-beta.6",
"coveralls": "2.11.8",
"doctrine": "^1.2.0",
Copy link
Member

Choose a reason for hiding this comment

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

this would need to be a full dependency since it's not related to actually developing the module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops! Quite right.
On 25 Mar 2016 01:46, "Jordan Harband" notifications@github.com wrote:

In package.json
#513 (comment)
:

@@ -25,6 +25,7 @@
"devDependencies": {
"babel-eslint": "6.0.0-beta.6",
"coveralls": "2.11.8",

  • "doctrine": "^1.2.0",

this would need to be a full dependency since it's not related to
actually developing the module.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/yannickcr/eslint-plugin-react/pull/513/files/f3e634c59e8928ab170a9bfa9d056cf0f8778064#r57411882

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.057% when pulling 875421d on gausie:feature/explicit-react-component-parent into e3c27f9 on yannickcr:master.

@yannickcr yannickcr merged commit 8cbbe4d into jsx-eslint:master Jun 5, 2016
@yannickcr
Copy link
Member

Merged, thanks!

@ljharb
Copy link
Member

ljharb commented Jun 5, 2016

I wonder if we should make doctrine an optionalDependency, so people that don't use jsdoc don't need to install it?

@yannickcr
Copy link
Member

I don't like adding a dependency either.

But since this dependency is already used by ESLint I think it will already be installed in all cases (it will even be deduplicated with npm@3).

@ljharb
Copy link
Member

ljharb commented Jun 5, 2016

An, makes sense

@gausie gausie deleted the feature/explicit-react-component-parent branch June 5, 2016 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants