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

Should this be a config, not a plugin? #1

Closed
wants to merge 1 commit into from
Closed

Should this be a config, not a plugin? #1

wants to merge 1 commit into from

Conversation

JosieMcClellan
Copy link

(I'm a student and this is my first PR anywhere, please excuse me if I do something wrong).

This doesn't seem to work currently because it's written like a config, but calls itself a plugin. A plugin takes a little extra setup, but you can do more with a it (e.g. define rules).

I just turned this into a config and it works, but if you expect to define rules in the future, please ignore this PR and structure it like a plugin instead (or I can try to). Of course if you do accept the PR, you should also change the repo's name and description.

in 'eslintrc', this is 'extends'
@brian-mann
Copy link
Member

@chrisbreiding what do you think? Did we actually have this running anywhere in a project?

@brian-mann
Copy link
Member

brian-mann commented Nov 26, 2017

This is a bit too opinionated now. I think you could restrict the files to be cypress/** but not _spec or _test since we don't want to enforce naming conventions with your test files.

Also not sure about the arrow functions - its true that when using those you cannot use mocha's this.* context, but it's also not required, you can write test code perfectly fine without ever using this.

@JosieMcClellan
Copy link
Author

JosieMcClellan commented Nov 27, 2017

Sorry, forgot anything on the branch would be in the PR. I'll change it back.
(done)

@brian-mann
Copy link
Member

I think restricting the files is a good idea but just to cypress. Tomorrow we'll likely get this merged in.

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Nov 27, 2017

Thanks for the PR. I think I'd like to keep this as a plugin, since we might add rules in the future. I realized it makes more sense to specify an env for Cypress instead of using extends, so I've done that and released 2.0.0.

With 2.0.0, you can configure it like so:

{
  "plugins": [
    "cypress"
  ],
  "env": {
    "cypress/globals": true
  }
}

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

Successfully merging this pull request may close these issues.

None yet

3 participants