Skip to content

Commit

Permalink
Deploying to gh-pages from @ cb53931 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Dec 14, 2024
1 parent ac757a4 commit f3f8050
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.6.3">
<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" href="/typescript-style-guide/opensearch.xml"><link rel="stylesheet" href="/typescript-style-guide/assets/css/styles.b9c2dba5.css">
<script src="/typescript-style-guide/assets/js/runtime~main.fddda1aa.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/runtime~main.93e99987.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/main.59c0918a.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
Expand Down
1 change: 0 additions & 1 deletion assets/js/e7ce6630.20d1a8fe.js

This file was deleted.

1 change: 1 addition & 0 deletions assets/js/e7ce6630.275bc014.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/js/runtime~main.93e99987.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion assets/js/runtime~main.fddda1aa.js

This file was deleted.

4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.6.3">
<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 to create consistent, maintainable code."><meta data-rh="true" property="og:description" content="TypeScript Style Guide provides a concise set of conventions and best practices to create 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" href="/typescript-style-guide/opensearch.xml"><link rel="stylesheet" href="/typescript-style-guide/assets/css/styles.b9c2dba5.css">
<script src="/typescript-style-guide/assets/js/runtime~main.fddda1aa.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/runtime~main.93e99987.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/main.59c0918a.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
Expand Down Expand Up @@ -154,7 +154,7 @@ <h3 class="anchor anchorWithStickyNavbar_LWe7" id="type--non-nullability-asserti
<!-- -->They can only be used as an exception (e.g. third party library types mismatch, dereferencing <code>unknown</code> etc.) with a strong rational for why it&#x27;s introduced into the codebase.</p>
<div class="language-ts codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#f8f8f2;--prism-background-color:#272822"><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 keyword" style="color:#66d9ef">type</span><span class="token plain"> </span><span class="token class-name" style="color:#e6db74">User</span><span class="token plain"> </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"> id</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token builtin" style="color:#e6db74">string</span><span class="token punctuation" style="color:#f8f8f2">;</span><span class="token plain"> username</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token builtin" style="color:#e6db74">string</span><span class="token punctuation" style="color:#f8f8f2">;</span><span class="token plain"> avatar</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token builtin" style="color:#e6db74">string</span><span class="token plain"> </span><span class="token operator" style="color:#66d9ef">|</span><span class="token plain"> </span><span class="token keyword" style="color:#66d9ef">null</span><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 comment" style="color:#8292a2;font-style:italic">// ❌ Avoid type assertions</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"></span><span class="token keyword" style="color:#66d9ef">const</span><span class="token plain"> user </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"> name</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token string" style="color:#a6e22e">&#x27;Nika&#x27;</span><span class="token plain"> </span><span class="token punctuation" style="color:#f8f8f2">}</span><span class="token plain"> </span><span class="token keyword" style="color:#66d9ef">as</span><span class="token plain"> User</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 comment" style="color:#8292a2;font-style:italic">// ❌ Avoid non-nullability assertions</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"></span><span class="token function" style="color:#e6db74">renderUserAvatar</span><span class="token punctuation" style="color:#f8f8f2">(</span><span class="token plain">user</span><span class="token operator" style="color:#66d9ef">!</span><span class="token punctuation" style="color:#f8f8f2">.</span><span class="token plain">avatar</span><span class="token punctuation" style="color:#f8f8f2">)</span><span class="token punctuation" style="color:#f8f8f2">;</span><span class="token plain"> </span><span class="token comment" style="color:#8292a2;font-style:italic">// Runtime error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#f8f8f2"><span class="token plain"></span><span class="token keyword" style="color:#66d9ef">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:#e6db74">renderUserAvatar</span><span class="token plain"> </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">avatar</span><span class="token operator" style="color:#66d9ef">:</span><span class="token plain"> </span><span class="token builtin" style="color:#e6db74">string</span><span class="token punctuation" style="color:#f8f8f2">)</span><span class="token plain"> </span><span class="token operator" style="color:#66d9ef">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#f8f8f2">{</span><span class="token operator" style="color:#66d9ef">...</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>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="type-error">Type Error<a href="#type-error" class="hash-link" aria-label="Direct link to Type Error" title="Direct link to Type Error"></a></h3>
<p>When a TypeScript error cannot be mitigated, use <code>@ts-expect-error</code> as a last resort to suppress it. This directive allows the TypeScript compiler to notify you if the suppressed line becomes error-free in the future.</p>
<p>When a TypeScript error cannot be mitigated, use <code>@ts-expect-error</code> as a last resort to suppress it. This directive enables the TypeScript compiler to indicate when the suppressed line no longer contains an error.</p>
<ul>
<li>Always use <code>@ts-expect-error</code> with a clear description explaining why it is necessary.</li>
<li>Avoid using <code>@ts-ignore</code>, as it does not provide the same level of safety and accountability as @ts-expect-error.</li>
Expand Down
Loading

0 comments on commit f3f8050

Please sign in to comment.