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

Disable ava+node plugins for pure browser projects #610

Open
devinrhode2 opened this issue Oct 1, 2021 · 4 comments
Open

Disable ava+node plugins for pure browser projects #610

devinrhode2 opened this issue Oct 1, 2021 · 4 comments

Comments

@devinrhode2
Copy link
Contributor

I think ava is great, but I am working on a purely frontend project, so have no need for it.

I think for now I can just use patch-package, I'm not sure of a good design to "remove" or "disable" a plugin.

Maybe, it would make sense to group it along with vue and react - not included by default

@sindresorhus
Copy link
Member

sindresorhus commented Oct 1, 2021

The AVA rules only apply to AVA test files, so I don't really see the problem. Are you encountering any errors?

@devinrhode2
Copy link
Contributor Author

devinrhode2 commented Oct 1, 2021

Not encountering any errors, just being picky 😊

One benefit would be faster npm installs.

How does XO detect ava test files? *.test.*? (This would certainly catch more than ava test files) Perhaps if detecting ava test files is not trivial, there would also be performance boost here

(although - ava looks super nice)

Closing as it's not a real "issue" - but, we can keep discussing

@sindresorhus
Copy link
Member

One benefit would be faster npm installs.

That would be negligible.

How does XO detect ava test files?

It just checks the import statement. I don't think that has much overhead.

@devinrhode2
Copy link
Contributor Author

Maybe we could check if ava is installed in package.json, at least then the rules aren't loaded, and presumably, no parsing import statements. Still have the npm install waste, though.

Likewise, for the node plugin, we could avoid injecting it if nodeVersion is set to false. Related thing I need to figure out: https://github.com/xojs/xo/pull/606/files

For now I am just using patch-package, which isn't all that hard to maintain

@devinrhode2 devinrhode2 changed the title Disable ava Disable ava+node plugins for pure browser projects Oct 28, 2021
@devinrhode2 devinrhode2 reopened this Oct 28, 2021
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

3 participants