evelynhathaway / eslint-plugin-evelyn

🔮🧹 ESLint plugin for my projects with my preferred code style and bugfixes

Home Page:https://npmjs.com/package/eslint-plugin-evelyn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: Publish `no-fallthrough` rule as its own npm package

binary64 opened this issue · comments

I would like to use no-fallthrough but am scared about the number of deps this package has.

Whoops, is this it: https://eslint.org/docs/rules/no-fallthrough ?

Or does yours have differences?

Totally fair! no-fallthrough from this package used to be a fork of the ESLint version that worked better with case blocks. Their stale bot closed and locked my pull request from a few years ago (eslint/eslint#11016), and I added it to this package since I thought not many cared much about this edge case.

But now, if you set up eslint ^7.29.0 (changelog), you should experience the same behavior as my version since someone else implemented a similar fix. I am both thankful and salty that someone else got this fixed almost three years later haha!

I will be verifying the native version of no-fallthrough works the same as mine now and then remove it in the next major version.

I verified the native version of no-fallthrough from ESLint and it only fails one of the tests:

{
code: "switch (foo) { case 0: { a();\n// falls through\n} // comment\n default: b(); }",
errors: errorsDefault
},

This edge case is not one I am interested in preserving, so as planned, I will remove this in the next major version. Feel free to use the native version! 🚀