Skip to content

Commit fb6451c

Browse files
committed
Deploying to gh-pages from @ 72bb29e 🚀
1 parent 3b4428c commit fb6451c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="generator" content="Docusaurus v3.7.0">
66
<title data-rh="true">Page Not Found | </title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" name="twitter:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" property="og:url" content="https://mkosir.github.io/typescript-style-guide/404.html"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Page Not Found | "><link data-rh="true" rel="icon" href="/typescript-style-guide/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://mkosir.github.io/typescript-style-guide/404.html"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/404.html" hreflang="en"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/404.html" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://3CBFIG0U2G-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" title=" " href="/typescript-style-guide/opensearch.xml"><link rel="stylesheet" href="/typescript-style-guide/assets/css/styles.ae277015.css">
7-
<script src="/typescript-style-guide/assets/js/runtime~main.1678aec0.js" defer="defer"></script>
7+
<script src="/typescript-style-guide/assets/js/runtime~main.6991d925.js" defer="defer"></script>
88
<script src="/typescript-style-guide/assets/js/main.1eebe325.js" defer="defer"></script>
99
</head>
1010
<body class="navigation-with-keyboard">

assets/js/e7ce6630.d124123c.js renamed to assets/js/e7ce6630.019a462e.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/runtime~main.1678aec0.js renamed to assets/js/runtime~main.6991d925.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="generator" content="Docusaurus v3.7.0">
66
<title data-rh="true">TypeScript Style Guide | </title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" name="twitter:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" property="og:url" content="https://mkosir.github.io/typescript-style-guide/"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="TypeScript Style Guide | "><meta data-rh="true" name="description" content="TypeScript Style Guide provides a concise set of conventions and best practices for creating consistent, maintainable code."><meta data-rh="true" property="og:description" content="TypeScript Style Guide provides a concise set of conventions and best practices for creating consistent, maintainable code."><link data-rh="true" rel="icon" href="/typescript-style-guide/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://mkosir.github.io/typescript-style-guide/"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/" hreflang="en"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://3CBFIG0U2G-dsn.algolia.net" crossorigin="anonymous"><script data-rh="true">function insertBanner(){var n=document.createElement("div");n.id="__docusaurus-base-url-issue-banner-container";n.innerHTML='\n<div id="__docusaurus-base-url-issue-banner" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">/typescript-style-guide/</span> </p>\n <p>We suggest trying baseUrl = <span id="__docusaurus-base-url-issue-banner-suggestion-container" style="font-weight: bold; color: green;"></span></p>\n</div>\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),s=window.location.pathname,o="/"===s.substr(-1)?s:s+"/";e.innerHTML=o}document.addEventListener("DOMContentLoaded",(function(){void 0===window.docusaurus&&insertBanner()}))</script><link rel="search" type="application/opensearchdescription+xml" title=" " href="/typescript-style-guide/opensearch.xml"><link rel="stylesheet" href="/typescript-style-guide/assets/css/styles.ae277015.css">
7-
<script src="/typescript-style-guide/assets/js/runtime~main.1678aec0.js" defer="defer"></script>
7+
<script src="/typescript-style-guide/assets/js/runtime~main.6991d925.js" defer="defer"></script>
88
<script src="/typescript-style-guide/assets/js/main.1eebe325.js" defer="defer"></script>
99
</head>
1010
<body class="navigation-with-keyboard">
@@ -275,11 +275,11 @@ <h3 class="anchor anchorWithStickyNavbar_LWe7" id="enums--const-assertion">Enums
275275
<p>Enums are generally discouraged in the TypeScript ecosystem due to their runtime cost and quirks.<br>
276276
<!-- -->The TypeScript documentation outlines several <a href="https://www.typescriptlang.org/docs/handbook/enums.html#const-enum-pitfalls" target="_blank" rel="noopener noreferrer">pitfalls</a>, and recently introduced the <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-8.html#the---erasablesyntaxonly-option" target="_blank" rel="noopener noreferrer">--erasableSyntaxOnly</a> flag to disable runtime-generating features like enums altogether.</p>
277277
<div> <span><button class="dark:bg-opacity-40 dark:hover:bg-opacity-40 mb-1 inline-flex cursor-pointer items-center rounded-md bg-gray-100 px-1.5 py-1 text-xs font-medium text-neutral-600 transition-colors duration-100 hover:bg-gray-200 dark:bg-blue-900 dark:text-neutral-200 dark:hover:bg-blue-950"><span class="mr-1"><span class="ease inline-block transform transition-all duration-500 rotate-0">📏</span> <!-- -->Rule</span></button><div aria-hidden="true" class="rah-static rah-static--height-zero" style="height:0;overflow:hidden"><div><div class="rounded-md border-0 border-l-[5px] border-solid border-neutral-500 bg-gray-200 p-2 text-xs text-neutral-600 italic dark:border-gray-200 dark:bg-neutral-600 dark:text-gray-200 [&amp;_p]:mb-0"><a class="inline-flex items-center text-sm font-medium text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-400 dark:hover:text-blue-500" href="https://eslint.org/docs/latest/rules/no-restricted-syntax" rel="noopener noreferrer" target="_blank"><span>Rule</span><span class="ml-0.5 flex items-center"><svg aria-hidden="true" class="inline-block" fill="none" height="15px" viewBox="0 0 24 24" width="15px" xmlns="http://www.w3.org/2000/svg"><g id="Interface / External_Link"><path d="M10.0002 5H8.2002C7.08009 5 6.51962 5 6.0918 5.21799C5.71547 5.40973 5.40973 5.71547 5.21799 6.0918C5 6.51962 5 7.08009 5 8.2002V15.8002C5 16.9203 5 17.4801 5.21799 17.9079C5.40973 18.2842 5.71547 18.5905 6.0918 18.7822C6.5192 19 7.07899 19 8.19691 19H15.8031C16.921 19 17.48 19 17.9074 18.7822C18.2837 18.5905 18.5905 18.2839 18.7822 17.9076C19 17.4802 19 16.921 19 15.8031V14M20 9V4M20 4H15M20 4L13 11" id="Vector" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></g></svg></span></a><div class="mt-1 mb-0! text-sm language-ts codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#f8f8f2;--prism-background-color:#272822"><div class="codeBlockTitle_Ktv7">eslint.config.mjs</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-ts codeBlock_bY9V thin-scrollbar" style="color:#f8f8f2;background-color:#272822"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#f8f8f2"><span class="token string-property property" style="color:#f92672">&#x27;no-restricted-syntax&#x27;</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#f8f8f2">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"> </span><span class="token string" style="color:#a6e22e">&#x27;error&#x27;</span><span class="token punctuation" style="color:#f8f8f2">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"> </span><span class="token punctuation" style="color:#f8f8f2">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"> selector</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token string" style="color:#a6e22e">&#x27;TSEnumDeclaration&#x27;</span><span class="token punctuation" style="color:#f8f8f2">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"> message</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token string" style="color:#a6e22e">&#x27;Replace enum with a literal type or a const assertion.&#x27;</span><span class="token punctuation" style="color:#f8f8f2">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"> </span><span class="token punctuation" style="color:#f8f8f2">}</span><span class="token punctuation" style="color:#f8f8f2">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"></span><span class="token punctuation" style="color:#f8f8f2">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></span></div>
278-
<p>As rule of a thumb, try to:</p>
278+
<p>As rule of a thumb, prefer:</p>
279279
<ul>
280-
<li>Use literal types whenever possible.</li>
281-
<li>Use const assertion arrays when you need to loop through the values.</li>
282-
<li>Use const assertion objects when there is a strong use case for them.</li>
280+
<li>Literal types whenever possible.</li>
281+
<li>Const assertion arrays when looping through values.</li>
282+
<li>Const assertion objects when enumerating arbitrary values.</li>
283283
</ul>
284284
<p>Examples:</p>
285285
<ul>

0 commit comments

Comments
 (0)