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

Add support for eslint-plugin-jest #7232

Open
wesleycho opened this issue Jun 16, 2019 · 1 comment
Open

Add support for eslint-plugin-jest #7232

wesleycho opened this issue Jun 16, 2019 · 1 comment
Assignees

Comments

@wesleycho
Copy link

For typical development while using create-react-app, inevitability there will be a time when developers accidentally commit stuff like fit or fdescribe - I would like CRA to have built in support for eslint-plugin-jest and set those as warnings so they can be caught as hard errors in CI.

@mrmckeb mrmckeb self-assigned this Jun 23, 2019
@mrmckeb
Copy link
Contributor

mrmckeb commented Jun 23, 2019

Hi @wesleycho, you can already add this by extending our ESLint config.

For example, in your package.json:

{ 
  "eslintConfig": {
    "extends": ["react-app"],
    "plugins": [],
    "rules": {}
  }
}

Right now, these will be used by your editor, but won't break builds.

My team use lint-staged with husky to run a pre-commit hook that performs a command, and if it fails, the commit won't happen. You can see more on that here: https://facebook.github.io/create-react-app/docs/setting-up-your-editor#formatting-code-automatically

We generally only do linting on prepush and on the CI though...

Let me know if this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants