Skip to content

unnecessaryUseStricts

Reports unnecessary "use strict" directives in ES modules and classes.

✅ This rule is included in the ts logical presets.

ECMAScript modules and class bodies are automatically in strict mode. The "use strict" directive has no effect in these contexts and is redundant.

This rule reports on "use strict" directives that can be safely removed.

1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Duse stri1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">dAEexpo5<3 sp ansty="le--0:#C792EA;--1:#8844">AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0calcula1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53val7<2:sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0numb1<1)sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEretu53 valuA5<3 sp ansty="le--0:#F78C6C;--1:#AA09">8<22sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">5<3}d ivclassNa="meec-li">dAEexpo5<3 sp ansty="le--0:#C792EA;--1:#8844">AEcla5<3 sp ansty="le--0:#FFCB8B;--1:#1111">11Calculat53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#82AAFF;--1:#3B61">B0a1<1(sp ansty="le--0:#D7DBE0;--1:#403F">5<3asp ansty="le--0:#7FDBCA;--1:#096E">7<2:sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0numb<53sp ansty="le--0:#D6DE">EB<, sp ansty="le--0:#D7DB">E<0bsp ansty="le--0:#7FDBCA;--1:#096E">7<2:sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0numb1<1)sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu53 A53 53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3}d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>
44AEex344AEfunc361B0calcu1<111( spans="tyle--0:#D7DBE0;--1:#40">3F53v6361B0nu1<111) spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de44AEre3F53 va4<4AE* spans="tyle--0:#D6DEEB;--1:#40">30<9822 spans="tyle--0:#D6DEEB;--1:#40">33c44AEex344AEc31111Calcul3F<53 {divclass="Nameec-">de61B<0add spans="tyle--0:#D9F5DD;--1:#11">1<111( spans="tyle--0:#D7DBE0;--1:#40">36361B0nu<3F53 spans="tyle--0:#D6">DED6361B0nu1<111) spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">dent< spans="tyle--0:#C792EA;--1:#88">44AEre3F5<3 a spans="tyle--0:#C792EA;--1:#88">4<4AE+ spans="tyle--0:#D6DEEB;--1:#40">3F5<3 b ;divclass="Nameec-">3F<53 spans="tyle--0:#D6DEEB;--1:#40">33< }>

This rule is not configurable.

If you are working in a JavaScript environment with non-standard semantics, or otherwise have tooling that requires you to use seemingly redundant "use strict" directives, this rule might not be for you.