File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ import { isMemberExpression } from './ast/index.js' ;
12import { switchCallExpressionToNewExpression } from './fix/index.js' ;
23
34const messageId = 'throw-new-error' ;
@@ -23,6 +24,17 @@ const create = context => ({
2324 return ;
2425 }
2526
27+ // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2654 (Effect library)
28+ if (
29+ isMemberExpression ( callee , {
30+ object : 'Data' ,
31+ property : 'TaggedError' ,
32+ computed : false ,
33+ } )
34+ ) {
35+ return ;
36+ }
37+
2638 return {
2739 node,
2840 messageId,
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ test.snapshot({
2929 'throw lib["Error"]()' ,
3030 // Not `FooError` like
3131 'throw lib.getError()' ,
32+ // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2654 (Effect library)
33+ 'class QueryError extends Data.TaggedError(\'QueryError\') {}' ,
3234 ] ,
3335 invalid : [
3436 'throw Error()' ,
You can’t perform that action at this time.
0 commit comments