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

Problem with prop 'env' in /test/unit/.eslintrc #2

Open
gaoupon opened this issue Aug 7, 2017 · 4 comments
Open

Problem with prop 'env' in /test/unit/.eslintrc #2

gaoupon opened this issue Aug 7, 2017 · 4 comments

Comments

@gaoupon
Copy link
Contributor

gaoupon commented Aug 7, 2017

since it is a avoriaz-jest-example, shall we change 'mocha' to 'jest'?

@gaoupon gaoupon changed the title A little problem with prop 'env' in /test/unit/.eslintrc Problem with prop 'env' in /test/unit/.eslintrc Aug 7, 2017
@eddyerburgh
Copy link
Owner

Yes definitely, are you able make a PR?

@gaoupon
Copy link
Contributor Author

gaoupon commented Aug 8, 2017

My pleasure.

@eddyerburgh
Copy link
Owner

eddyerburgh commented Aug 8, 2017 via email

@gaoupon
Copy link
Contributor Author

gaoupon commented Aug 8, 2017

sorry for not seeing the message in time and I think the 'globals' prop is unneeded at the same file.
And in my opinion, a better and more flexible way to config eslint is to add "overrides" prop in the root/.eslintrc like this:

{
  ...,
  "overrides": [{
    "files": ["**/*.spec.js"],
    "env": {
      "jest": true
    }
  }]
}

In that way we can lint spec files not just in the test directory, but also any file in the project.

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

No branches or pull requests

2 participants