@@ -3,7 +3,7 @@ import type { RuleContext } from "@eslint-react/kit";
33import type { Scope } from "@typescript-eslint/scope-manager" ;
44import type { TSESTree } from "@typescript-eslint/types" ;
55import { type _ , dual } from "@eslint-react/eff" ;
6- import { DEFAULT_ESLINT_REACT_SETTINGS , unsafeDecodeSettings } from "@eslint-react/shared" ;
6+ import { coerceSettings , DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared" ;
77import { AST_NODE_TYPES as T } from "@typescript-eslint/types" ;
88
99import { isInitializedFromReact } from "./is-initialized-from-react" ;
@@ -59,7 +59,7 @@ export function isFromReact(name: string): isFromReact.ReturnType {
5959 // dprint-ignore
6060 return dual ( 2 , ( context : RuleContext , node : TSESTree . Node | _ ) : node is TSESTree . Identifier | TSESTree . MemberExpression => {
6161 if ( node == null ) return false ;
62- const { importSource = defaultImportSource , skipImportCheck = true } = unsafeDecodeSettings ( context . settings ) ;
62+ const { importSource = defaultImportSource , skipImportCheck = true } = coerceSettings ( context . settings ) ;
6363 if ( skipImportCheck ) return isFromReactLoose ( node , name ) ;
6464 return isFromReactStrict ( node , name , importSource , context . sourceCode . getScope ( node ) ) ;
6565 } ) ;
@@ -70,7 +70,7 @@ export function isFromReactObject(objectName: string, propertyName: string): isF
7070 // dprint-ignore
7171 return dual ( 2 , ( context : RuleContext , node : TSESTree . Node | _ ) : node is TSESTree . Identifier | TSESTree . MemberExpression => {
7272 if ( node ?. type !== T . MemberExpression ) return false ;
73- const { importSource = defaultImportSource , skipImportCheck = true } = unsafeDecodeSettings ( context . settings ) ;
73+ const { importSource = defaultImportSource , skipImportCheck = true } = coerceSettings ( context . settings ) ;
7474 const { object, property } = node ;
7575 if ( skipImportCheck ) return isFromReactLoose ( object , objectName ) && isFromReactLoose ( property , propertyName ) ;
7676 return isFromReactStrict (
0 commit comments