@@ -1009,55 +1009,73 @@ ${this.#links()}`;
10091009 }
10101010
10111011 #links( ) : string {
1012+ const links = [ ] ;
1013+
1014+ if ( this . #insight. docs ) {
1015+ links . push ( this . #insight. docs ) ;
1016+ }
1017+
10121018 switch ( this . #insight. insightKey ) {
10131019 case 'CLSCulprits' :
1014- return `- https://web.dev/articles/cls
1015- - https://web.dev/articles/optimize-cls` ;
1020+ links . push ( 'https://web.dev/articles/cls' ) ;
1021+ links . push ( 'https://web.dev/articles/optimize-cls' ) ;
1022+ break ;
10161023 case 'DocumentLatency' :
1017- return '- https://web.dev/articles/optimize-ttfb' ;
1024+ links . push ( 'https://web.dev/articles/optimize-ttfb' ) ;
1025+ break ;
10181026 case 'DOMSize' :
1019- return '- https://developer.chrome.com/docs/lighthouse/performance/dom-size/' ;
1020- case 'DuplicatedJavaScript' :
1021- return '' ;
1027+ links . push ( 'https://developer.chrome.com/docs/lighthouse/performance/dom-size/' ) ;
1028+ break ;
10221029 case 'FontDisplay' :
1023- return `- https://web.dev/articles/preload-optional-fonts
1024- - https://fonts.google.com/knowledge/glossary/foit
1025- - https://developer.chrome.com/blog/font-fallbacks` ;
1030+ links . push ( 'https://web.dev/articles/preload-optional-fonts' ) ;
1031+ links . push ( 'https://fonts.google.com/knowledge/glossary/foit' ) ;
1032+ links . push ( 'https://developer.chrome.com/blog/font-fallbacks' ) ;
1033+ break ;
10261034 case 'ForcedReflow' :
1027- return '- https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing#avoid-forced-synchronous-layouts' ;
1035+ links . push (
1036+ 'https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing#avoid-forced-synchronous-layouts' ) ;
1037+ break ;
10281038 case 'ImageDelivery' :
1029- return '- https://developer.chrome.com/docs/lighthouse/performance/uses-optimized-images/' ;
1039+ links . push ( 'https://developer.chrome.com/docs/lighthouse/performance/uses-optimized-images/' ) ;
1040+ break ;
10301041 case 'INPBreakdown' :
1031- return `- https://web.dev/articles/inp
1032- - https://web.dev/explore/how-to-optimize-inp
1033- - https://web.dev/articles/optimize-long-tasks
1034- - https://web.dev/articles/avoid-large-complex-layouts-and-layout-thrashing` ;
1035- case 'LCPDiscovery' :
1036- return `- https://web.dev/articles/lcp
1037- - https://web.dev/articles/optimize-lcp` ;
1042+ links . push ( 'https://web.dev/articles/inp' ) ;
1043+ links . push ( 'https://web.dev/explore/how-to-optimize-inp' ) ;
1044+ links . push ( 'https://web.dev/articles/optimize-long-tasks' ) ;
1045+ links . push ( 'https://web.dev/articles/avoid-large-complex-layouts-and-layout-thrashing' ) ;
1046+ break ;
10381047 case 'LCPBreakdown' :
1039- return `- https://web.dev/articles/lcp
1040- - https://web.dev/articles/optimize-lcp` ;
1041- case 'NetworkDependencyTree' :
1042- return `- https://web.dev/learn/performance/understanding-the-critical-path
1043- - https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/` ;
1048+ case 'LCPDiscovery' :
10441049 case 'RenderBlocking' :
1045- return `- https://web.dev/articles/lcp
1046- - https://web.dev/articles/optimize-lcp` ;
1050+ links . push ( 'https://web.dev/articles/lcp' ) ;
1051+ links . push ( 'https://web.dev/articles/optimize-lcp' ) ;
1052+ break ;
1053+ case 'NetworkDependencyTree' :
1054+ links . push ( 'https://web.dev/learn/performance/understanding-the-critical-path' ) ;
1055+ links . push ( 'https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/' ) ;
1056+ break ;
10471057 case 'SlowCSSSelector' :
1048- return '- https://developer.chrome.com/docs/devtools/performance/selector-stats' ;
1058+ links . push ( 'https://developer.chrome.com/docs/devtools/performance/selector-stats' ) ;
1059+ break ;
10491060 case 'ThirdParties' :
1050- return '- https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/' ;
1061+ links . push ( 'https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/' ) ;
1062+ break ;
10511063 case 'Viewport' :
1052- return '- https://developer.chrome.com/blog/300ms-tap-delay-gone-away/' ;
1064+ links . push ( 'https://developer.chrome.com/blog/300ms-tap-delay-gone-away/' ) ;
1065+ break ;
10531066 case 'Cache' :
1054- return '- https://web.dev/uses-long-cache-ttl/' ;
1067+ links . push ( 'https://web.dev/uses-long-cache-ttl/' ) ;
1068+ break ;
10551069 case 'ModernHTTP' :
1056- return '- https://developer.chrome.com/docs/lighthouse/best-practices/uses-http2' ;
1070+ links . push ( 'https://developer.chrome.com/docs/lighthouse/best-practices/uses-http2' ) ;
1071+ break ;
10571072 case 'LegacyJavaScript' :
1058- return `- https://web.dev/articles/baseline-and-polyfills
1059- - https://philipwalton.com/articles/the-state-of-es5-on-the-web/` ;
1073+ links . push ( 'https://web.dev/articles/baseline-and-polyfills' ) ;
1074+ links . push ( 'https://philipwalton.com/articles/the-state-of-es5-on-the-web/' ) ;
1075+ break ;
10601076 }
1077+
1078+ return links . map ( link => '- ' + link ) . join ( '\n' ) ;
10611079 }
10621080
10631081 #description( ) : string {
0 commit comments