Reports mismatched types between getter and setter accessor pairs.
✅ This rule is included in the ts logical and logicalStrict presets.
TypeScript allows defining different types for a getter return and its corresponding setter parameter.
Defining drastically different types for a getter and setter can be confusing, as it means assigning a property to itself would not work.
This rule reports cases where a getter and setter have the same name but the getter’s return type is not assignable to the setter’s parameter type.
AEcla5<3 sp ansty="le--0:#FFCB8B;--1:#1111">11Examp3 sp>53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEg sp>5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0val3 sp>11<()sp ansty="le--0:#7FDBCA;--1:#096E">7()sp><2:sp ansty="le--0:#D6DEEB;--1:#403F">52:sp><3 sp ansty="le--0:#C5E478;--1:#3B61">B0stri3 sp>53 {d>< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu sp>5<3 sp ansty="le--0:#7FDBCA;--1:#096E">72th3 sp>A72_val5 {d><3;d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5 sp>3;d><3}d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEs sp>5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0val3 sp>1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53newVal1(sp>7<2:sp ansty="le--0:#D6DEEB;--1:#403F">52:sp><3 sp ansty="le--0:#C5E478;--1:#3B61">B0numb3 sp>1<1)sp ansty="le--0:#D6DEEB;--1:#403F">531)sp>3}d>< {d ivclassNa="meec-li">nt < sp ansty="le--0:#7FDBCA;--1:#096E">72th sp>A72_val5<3 sp ansty="le--0:#C792EA;--1:#8844">A3 sp>5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0Stri3 sp>53(newValue {d><);d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5 sp>);d><3}d ivclassNa="meec-li">53}d><3}d ivclassNa="meco"><}d>}d>3}d>AEinterfa53 Config< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEg sp>5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0val3 sp>11<()sp ansty="le--0:#7FDBCA;--1:#096E">7()sp><2:sp ansty="le--0:#D6DEEB;--1:#403F">52:sp><3 sp ansty="le--0:#C5E478;--1:#3B61">B0stri3 sp>5 {d><3;d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEs sp>5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0val3 sp>1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53newVal1(sp>7<2:sp ansty="le--0:#D6DEEB;--1:#403F">52:sp><3 sp ansty="le--0:#C5E478;--1:#3B61">B0numb3 sp>1<1)sp ansty="le--0:#D6DEEB;--1:#403F">51)sp>3;d><3;d ivclassNa="meec-li">53;d><3}d ivclassNa="meco"><}d>}d>3}d> 44AEc31111Exa3F<53 {divclass="Nameec-">de44A361B0v11<11() spans="tyle--0:#7FDBCA;--1:#09">611()>361B0st3F53 ><53 {divclass="Nameec-">dent< spans="tyle--0:#C792EA;--1:#88">44AEre >36E724<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72_v4AE.>353 >3F<53 spans="tyle--0:#D6DEEB;--1:#40">353 >de44A361B0v1<111( spans="tyle--0:#D7DBE0;--1:#40">3F53newV111(>6361B0st1<111) spans="tyle--0:#D6DEEB;--1:#40">3F111)><53 {divclass="Nameec-">dent< spans="tyle--0:#7FDBCA;--1:#09">6E72 >4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72_v4AE.>34<4AE= spans="tyle--0:#D6DEEB;--1:#40">3F53 newVa4AE=>53 >3F<53 spans="tyle--0:#D6DEEB;--1:#40">353 >3< }> }><}di vdivclass="Nameexpressive-">44AEc31111Exa3F<53 {divclass="Nameec-">de44A361B0v11<11() spans="tyle--0:#7FDBCA;--1:#09">611()>361B0st3F53 ><53 {divclass="Nameec-">dent< spans="tyle--0:#C792EA;--1:#88">44AEre >36E724<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72_v4AE.>353 >3F<53 spans="tyle--0:#D6DEEB;--1:#40">353 >de44A361B0v1<111( spans="tyle--0:#D7DBE0;--1:#40">3F53newV111(>6361B0st36361B0nu1<111) spans="tyle--0:#D6DEEB;--1:#40">3F111)><53 {divclass="Nameec-">dent< spans="tyle--0:#7FDBCA;--1:#09">6E72 >4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72_v4AE.>34<4AE= spans="tyle--0:#D6DEEB;--1:#40">34AE=>61B0St3F53(newVal53 >3F<53 spans="tyle--0:#D6DEEB;--1:#40">353 >3< }> }>}di>
This rule is not configurable.
If your project needs to model unusual relationships between data, such as older DOM types, this rule might not be for you.
You might consider using Flint disable comments and/or configuration file disables for those specific situations instead of completely disabling this rule.