xo icon indicating copy to clipboard operation
xo copied to clipboard

Disable ava+node plugins for pure browser projects

Open devinrhode2 opened this issue 4 years ago • 4 comments

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

devinrhode2 avatar Oct 01 '21 03:10 devinrhode2

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

sindresorhus avatar Oct 01 '21 03:10 sindresorhus

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

devinrhode2 avatar Oct 01 '21 14:10 devinrhode2

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.

sindresorhus avatar Oct 01 '21 14:10 sindresorhus

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 avatar Oct 28 '21 03:10 devinrhode2