diff --git a/public/docs/ts/latest/guide/style-guide.jade b/public/docs/ts/latest/guide/style-guide.jade index 244ee86f62..37586f1cce 100644 --- a/public/docs/ts/latest/guide/style-guide.jade +++ b/public/docs/ts/latest/guide/style-guide.jade @@ -1175,13 +1175,13 @@ a(href="#toc") Back to top #### Style 04-10 -.s-rule.do +.s-rule.consider :marked - **Do** create a file that imports, aggregates, and re-exports items. We call this technique a **barrel**. + **Consider** creating a file that imports, aggregates, and re-exports items. We call this technique a **barrel**. -.s-rule.do +.s-rule.consider :marked - **Do** name this barrel file `index.ts`. + **Consider** naming this barrel file `index.ts`. .s-why :marked @@ -1190,6 +1190,14 @@ a(href="#toc") Back to top .s-why :marked **Why?** A barrel reduces the number of imports a file may need. + +.s-why + :marked + **Why?** A barrel provides a consistent pattern to import everything exported in the barrel from a folder. + +.s-why + :marked + **Why?** This is consistent with a pattern from Node, which imports the index.js|ts file from a folder. .s-why.s-why-last :marked