Reports empty export statements that don't make a file a module.
✅ This rule is included in the ts logical and logicalStrict presets.
An empty export {} statement is sometimes useful in TypeScript code to turn a file that would otherwise be a script into a module.
Per the TypeScript Handbook Modules page:
In TypeScript, just as in ECMAScript 2015, any file containing a top-level import or export is considered a module.
Conversely, a file without any top-level import or export declarations is treated as a script whose contents are available in the global scope.
However, an export {} statement does nothing if there are any other top-level import or export statements in a file.
This rule reports an export {} that doesn’t do anything in a file already using ES modules.
AEexport consB0valAE = <{}sp ansty="le--0:#D6DEEB;--1:#403F">5{}sp><3;d ivclassNa="meec-li">AEexpo53 {3;d><};d ivclassNa="meco"><};d>};d>};d>AEexpo5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B3 sp><0*sp ansty="le--0:#D6DEEB;--1:#403F">50*sp><3 sp ansty="le--0:#C792EA;--1:#8844">AEfr3 sp>5<3 sp ansty="le--0:#D9F5DD;--1:#1111">13 sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4Dmodu1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">51"sp><3;d ivclassNa="meec-li">AEexpo53 {3;d><};d ivclassNa="meco"><};d>};d>};d>AEimpo53 { something <} sp ansty="le--0:#C792EA;--1:#8844">AEfr} sp>5<3 sp ansty="le--0:#D9F5DD;--1:#1111">13 sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4Dmodu1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">51"sp><3;d ivclassNa="meec-li">d3;d>AEexpo53 {<};d ivclassNa="meco"><};d>};d>};d> 44AEexport co61B0v44AE <= {} spans="tyle--0:#D6DEEB;--1:#40">3= {}>44AEex36<1B0* spans="tyle--0:#D6DEEB;--1:#40">31B0*>44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dmo111">1<111" spans="tyle--0:#D6DEEB;--1:#40">3111">;di><;di vdivclass="Nameexpressive-">44AEex3F53< {} ;divclass="Name">< {}> {}> {}>;di><;di vdivclass="Nameexpressive-">44AEim3F53 { somethin44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dmo111">1<111" spans="tyle--0:#D6DEEB;--1:#40">3111">c3F53con4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B4AE.><0log spans="tyle--0:#D6DEEB;--1:#40">3F53(somethi0log>;di>
This rule is not configurable.
If you don’t mind an empty export {} at the bottom of files, you likely don’t need this rule.
Some codebases prefer explicit module markers for consistency.