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

Adding custom rules #681

Closed
yantakus opened this issue Nov 10, 2016 · 4 comments

Comments

@yantakus
Copy link

commented Nov 10, 2016

If I want to add a rule, I can't do this right? There's no rules and extends configuration options.

So if I just want to add a single rule which is very important for my team (react/prop-types), I have to use eslint instead. Or I overlooked something?

@dcousens

This comment has been minimized.

@dcousens dcousens closed this Nov 11, 2016

@dcousens dcousens added the question label Nov 11, 2016

@yantakus

This comment has been minimized.

Copy link
Author

commented Nov 11, 2016

"Can you make rule X configurable" section says nothing about adding rules. Configure (edit/override) is not add.

In my case I just can't use Standard because it is missing a single rule - react/prop-types. This is absolutely necessary for any React project.

@dcousens

This comment has been minimized.

Copy link
Member

commented Nov 11, 2016

If you just want to tweak a couple rules, consider using this shareable config and layering your changes on top.

...

consider using this shareable config and layering your changes on top.

...

consider using this shareable config and layering your changes on top.

...

Then, add this to your .eslintrc file:

{
  "extends": "standard"
}

Example .eslintrc for your project

{
    "extends": "standard",
    "rules": {
      "react/prop-types": ["error", "always"]
    }
}

Hope that helps 😄
I don't know if it could really get any simpler? 👍

@chuyik

This comment has been minimized.

Copy link

commented Jan 12, 2017

@yantakus Hi I just write a repo to make it happen, if that's really what you want: https://github.com/o2team/standard-own

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.