lo1tuma / eslint-plugin-mocha

ESLint rules for mocha
MIT License
281 stars 61 forks source link

false positive with non mocha hook #296

Open fgarcia opened 3 years ago

fgarcia commented 3 years ago

I am getting false positives in the rule mocha/no-sibling-hooks when calling a function called setup. I don't think it is a Mocha hook, otherwise it would be nice being able to disable each hook individually.

My code base tests is full of setup functions. It is a convention to quickly locate how the main object under test is built and/or modify the base build.

lo1tuma commented 3 years ago

It is a mocha hook when using the TDD interface, you can read more about it in the official mocha docs.

However, I think it would be a good idea if we could specify the interface, so we only report problems on hooks matching the configured interface. I’ve already started some work on that, as part of a major refactoring of the whole codebase. I really hope to get this finished soon.