<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>thr3a</author_name>
  <author_url>https://blog.hatena.ne.jp/thr3a/</author_url>
  <blog_title>動かざることバグの如し</blog_title>
  <blog_url>https://blog.turai.work/</blog_url>
  <categories>
    <anon>typescript</anon>
  </categories>
  <description>環境 TypeScript 問題 TSで同一ディレクトリに同じ変数を宣言できない 例えば ├── hoge.ts ├── piyo.ts で両方で const hoge = 1; とすると Cannot redeclare block-scoped variable 'hoge'.ts(2451) 'hoge' was also declared here. const hoge: any[] とエラーになる 対処法 コードの末尾に export {}; をつけてグローバル変数にならないようにブロック化する。 const hoge = 1; export {}; 参考リンク TypeScrip…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.turai.work%2Fentry%2F20231019%2F1697642413&quot; title=&quot;TSでCannot redeclare block-scoped variableエラー - 動かざることバグの如し&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-10-19 00:20:13</published>
  <title>TSでCannot redeclare block-scoped variableエラー</title>
  <type>rich</type>
  <url>https://blog.turai.work/entry/20231019/1697642413</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
