eslint-plugin-unicorn icon indicating copy to clipboard operation
eslint-plugin-unicorn copied to clipboard

Add `prefer-error-cause` rule

Open jopemachine opened this issue 2 years ago • 8 comments

Added prefer-error-cause rule, Fixes #1342.

I'm trying to create many tests as possible I can.

https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1342#issuecomment-1085527190 this rule is not implemented yet in this PR, but I made this PR because I thought it'd be good to get some feedback before going further.

And this PR includes some uncertain assumptions such that the object argument including the cause property should exist at the last argument of the expression.

Any kind of reviews would be highly appreciated.

jopemachine avatar Apr 09 '22 09:04 jopemachine

Reviewing a lint rule in detail is a lot of work. Please look over your own diff and try to improve and simplify the code: https://github.com/sindresorhus/eslint-plugin-unicorn/pull/1793/files

sindresorhus avatar Apr 11 '22 08:04 sindresorhus

I'm really sorry. Super busy recently, I'll review ASAP.

fisker avatar Apr 27 '22 08:04 fisker

Can you fix the failing tests?

fisker avatar May 21 '22 10:05 fisker

@jopemachine Bump :)

sindresorhus avatar Jun 04 '22 09:06 sindresorhus

I'm sorry for the late response. I checked the integration test passed on my local mac.

jopemachine avatar Jun 05 '22 02:06 jopemachine

Can you fix the merge conflict?

sindresorhus avatar Jun 30 '22 16:06 sindresorhus

Failing: https://github.com/sindresorhus/eslint-plugin-unicorn/runs/7158388862?check_suite_focus=true

sindresorhus avatar Jul 05 '22 21:07 sindresorhus

Failing: sindresorhus/eslint-plugin-unicorn/runs/7158388862?check_suite_focus=true

I'm trying to resolve this issue, but I'm not sure how to handle this. CI failed because run-rules-on-codebase test includes the prefer-error-cause rule when checking intergration/test.mjs file. But when I added eslint-disable comment on the intergration/test.mjs's failed lines, it cause lint error due to eslint can not find prefer-error-cause rule.

jopemachine avatar Aug 14 '22 07:08 jopemachine

Bump

sindresorhus avatar Jun 20 '23 12:06 sindresorhus

Closing for lack of activity.

sindresorhus avatar Oct 29 '23 18:10 sindresorhus