投稿時間:2021-06-30 19:39:34 RSSフィード2021-06-30 19:00 分まとめ(47件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Engadget Japanese ポケモンGO 7月イベント発表。伝説レイドはデオキシスD・ミュウツー。GO Fest 2021は17・18日 https://japanese.engadget.com/pokemon-go-july-events-091736560.html gofest 2021-06-30 09:17:36
ROBOT ロボスタ ドコモが5G/6Gのカバレッジを拡張する最新技術「つまむアンテナ」を公開 「docomo Special Showcase in Tokyo」 https://robotstart.info/2021/06/30/mwc21-docomo-02.html mwcdocomospecialshowca 2021-06-30 09:46:36
ROBOT ロボスタ ドコモが5G高度化/6Gへの取り組みを報道向けに公開 「MWC 2021」の展示技術を「docomo Special Showcase in Tokyo」で https://robotstart.info/2021/06/30/mwc21-docomo-01.html docomo 2021-06-30 09:36:06
IT 情報システムリーダーのためのIT情報専門サイト IT Leaders 鈴与シンワート、チャットを介して書類を申請・承認できる「Biz-Oin」にTeams版 | IT Leaders https://it.impress.co.jp/articles/-/21703 鈴与シンワート、チャットを介して書類を申請・承認できる「BizOin」にTeams版ITLeaders鈴与シンワートは年月日、書類と印鑑を用いた申請承認ワークフローをチャットボットを使って電子化するサービス「BizOinビズオーイン」のラインアップを刷新した。 2021-06-30 18:40:00
python Pythonタグが付けられた新着投稿 - Qiita PythonでDICOM画像を読み込み画素値を書き換える https://qiita.com/Jino_L031/items/fd3e99a7f4602aca3758 jupyternotebook上で画像を表示するにはmatplotlibinlineも忘れずに。 2021-06-30 18:44:57
js JavaScriptタグが付けられた新着投稿 - Qiita 【Nuxt.js】$slotsを使ってみよう https://qiita.com/aLiz/items/01ee480f87c5f3a538a3 ただslotの状態によって表示非表示をvifで切り替えることはできませんでしたそれがslotsを使えばできるんです️スコープ付きスロットなどはこちらをご覧ください【Nuxtjs】slot文法編スコープ付きスロットを使おう描写render関数前置きでも書きましたが、Nuxtでこれを使うのは結構むずかしいですできること、NG例をご紹介します。 2021-06-30 18:44:52
js JavaScriptタグが付けられた新着投稿 - Qiita ゼロからESLintを理解する https://qiita.com/hayato94087/items/7b0f7607ebeea23f4e82 ゼロからESLintを理解するはじめに自身のメモとして本記事ではESLintについての概要を記述しますESLintの概要、Lintingの歴史、ESLintの全体像、そしてコマンドラインベースでSTEPbySTEPでのESLintの利用についての解説を行います別記事でReactの開発環境におけるESLintPrettyerstylelintの設定を記述いたしますESLintの概要ESLintとはJavasScriptのためのlinterですlinterとはコードを静的に解析しコンパイラーで検出されない潜在的なバグを警告するプログラムですlinterを導入することでコーディングの品質を高めることが出来ます静的にコードを解析する行為をLintingといいますESLintを利用することで、JavaScriptを静的に検証し、潜在的なバグを早期発見することが出来ます特にJavaScritpは歴史的背景からバグを生みやすい言語であるためlinterで潜在的なバグを潰しておくことは重要です公式サイトにも記述されていますが、ESLintにはつの特徴があります①問題発見ESLintはコードを静的に分析して、問題をすばやく見つけますESLintはほとんどのテキストエディタに組み込まれており、CICDパイプラインの一部としてESLintを実行できます②自動修正ESLintが見つけた多くの問題は自動的に修正できますESLintの修正は構文に対応しているため、従来の検索と置換のアルゴリズムによって発生するエラーは発生しません③カスタマイズコードを前処理し、カスタムパーサーを使用して、ESLintの組み込みルールと一緒に機能する独自のルールを記述しますESLintをカスタマイズして、プロジェクトに必要な方法で正確に機能させることができますつ目の特徴として自動修正があげられていますが、Prettierのほうがコードのフォーマッターとしては強力なため、Prettierを併用してESLintは利用されますLinterの歴史JavaScriptのLinterとしては年月現在npmのパッケージダウンロード数から見てESLintが一強で、ESLintの利用がデファクトだという事がわかりますJavaScriptのLinterの登場人物のざっくり説明ですJSLint公式サイト、wiki最初のJavaScriptのlinterと言われています記事年にのDouglasCrockfordダグラス・クロックフォードが作成しましたDouglasCrockfordは「JavaScriptTheGoodParts」の著者ですwiki、DouglasCrockfordの書籍JSHint公式サイト、wiki年にAntonKovalyovがJSLintをフォークして作成しましたJSLintの問題として構文ルールはDouglasCrockfordの個人のコーディングスタイルの思想が強く反映されており、他の開発者が意見できない仕様になっているため、構文チェックのルールをオフにしたり設定変更ができない問題がありましたJSHintではこれを解消しました記事AntonKovalyovWhyIforkedJSLinttoJSHint設定ファイルを使用して構文チェックのルールのONOFFの切り替えが可能です開発者コミュニティから支援されて開発された初めてのJavaScriptのlinterです記事JSHintACommunityDrivenForkofJSLintESLint公式サイト、wiki年にNicholasCZakasが作成しました記事、NicolasCZakasの書籍JSHintでは構文チェックのルールを拡張できない課題がありましたが、ESLintでは独自でルールを追加する可能にしこの問題を解消しました独自ルールの追加以外にJSHintでも可能であった構文チェックのルールのONOFFの切り替えも可能です記事UnderstandingtheRealAdvantagesofUsingESLint現在JavaScriptのlinterとして最も使われていますJSCS公式サイト年にMaratDulinが作成しました年にJSCSチームはESLintプロジェクトに合流し、JSCSのメンテナンスを中止しました記事JSCSEndofLife、記事WelcomingJSCStoESLintTSLint公式サイト年にPalantirTechnologiesがESLintに相当するTypeScriptのlinterを作成しましたJSLint、JSHint、ESLint、JSCSはJavaScriptのlinterですが、TSLintはTypeScriptのlinterです年にTypeScriptの構文チェック機能を備えたESLintの利用をTSLint公式として推奨し、TSLintは非推奨となりましたESLintの仕組みのざっくり理解するここではESLintの仕組みをざっくり解説します具体的にはルールとはなにか、ShareableConfigs共有設定とは何かを解説しますルールによる構文チェックESLintではコーディングの記述の正しさをルールを用いて判定していますルールに準拠することで、統一感のあるコーディングが実現でき、コードの品質を高めることが出来ますたとえば、空のブロックの仕様を禁止するルールのnoemptyを見ましょうnoemptyのルール上、下記の記述は正しくないため、ESLint上ではエラーがでますeslintnoemptyerroriffoowhilefooswitchfootrydoSomethingcatchexfinallynoemptyのルール上、下記の記述は正しいですeslintnoemptyerroriffooemptywhilefooemptytrydoSomethingcatchexcontinueregardlessoferrortrydoSomethingfinallycontinueregardlessoferror別のルールも見てみましょうsemiはセミコロンを強制するルールですsemiのルール上、下記の記述は正しくないため、ESLint上ではエラーがでますeslintsemierrorvarnameESLintobjectmethodfunctionsemiのルール上、下記の記述は正しいですeslintsemierrorvarnameESLintobjectmethodfunction先程のnoemptyやsemiを含めて公式のESLintから膨大なルールが提供されていますルール一覧はサイトで確認できますこれらルールを組み合わせて利用することで統一感のあるコーディングが実現でき、コードの品質を高めることが出来ますルールはデフォルトで有効化されていないため、どのルールを有効化するかを利用者が指定する必要がありますまた、ルールは独自でも作成可能なため、公式のESLintが提供するルールを使わなくてもlintingはできます開発者が独自でルールを作成する方法について下記を参照くださいESLintのルールを自作しよう分でわかるVSCodeとESLintを使用したカスタムルール作成方法ShareableConfig共有設定利用するルールを一つ一つ設定ファイルに記述するのは手間がかかりますESLintではShareableConfig共有設定という仕組みを使い、npmにパッケージを公開することで誰でも自分が設定しているルールを他のユーザに共有することができます別の言い方をすると、誰かが作ってくれた設定を使うことで、自身でルールの設定をすることなく、統一感のあるコーディングができますnpmjscomにてeslintconfigと検索すると、ESLintで利用可能なShareableConfig共有設定を検索することができます良いコーディングを実現するためにAirbnbやGoogleなどがコーディングスタイルを提供していますこれらコーディングスタイルはESLintにてShareableConfig共有設定として利用が可能ですESLintで利用される代表的なコーディングスタイルは下記ですAirbnbJavaScriptStyleGuideGitHub民泊サービスで知られるAirbnbが作成しているコーディングスタイルガイドですESLintで利用する際に候補としてあがる代表的なコーディングスタイルですGoogleJavaScriptStyleGuide公式ページ、GitHub、公式ページ和訳Googleが提供するコーディングスタイルガイドですこちらもESLintで利用する際に候補としてあがる代表的なコーディングスタイルですJavaScriptStandardStyleGuide公式ページ、GitHubAirbnbやGoogle以外で代表的なコーディングスタイルガイドですnpmtrendsでパッケージダウンロード数で見るとAirbnbが人気なのがわかりますスタイルガイドというのが適切かわからないですが、eslintconfigeslintにて公式のESLintが推奨するルールが提供されていますチェックマークが入っているのはESLintの公式が推奨しているルールですこれらルールの塊もShaerableConfig共有設定として利用が可能です自動修正されるルールESLintのつ目の特徴として自動修正がありましたが、すべてのルールが自動で修正されるわけではありませんESLintの公式が提供するルールの中で、レンチのアイコンが記載されているルールに限り、自動でコードの修正が可能です動作確認ESLintは自由度が高い構文チェックツールですので、手間を掛けずに挙動を確認できる環境デモサイトが公式から提供されていますESLintには大量のルールがあるため、自身にあったルール探したり、ルールごとの挙動を確認するのに役立ちますさわって理解するここでは実際にESLintを使ってざっくりどういうことができるか理解したいと思います動作環境の確認環境を確認しますnpmvnodevvESLintのインストールyarnを利用してeslintのパッケーをインストールしますyarnaddDeslintyarneslintvv設定ファイルの確認packagejsonを確認しますpackagejsondevDependencieseslinteslintrcjsonを確認しますeslintrcjsonはESLintの設定ファイルですどのような共有設定を読み込むか、ルールのチューニングなどを行いますeslintrcjsonextendseslintrecommendedpluginsparserOptionsenvglobalsrules記述されている内容だけ説明しますextendseslintrecommended先程インストールしたeslintに含まれるShareableConfigを利用していますeslintrecommendedを読み込むことで、チェックマークが入っているルール一覧がlintingに適応されますチャレンジglobal変数を理解するESLintの動作確認するconsoleexamplejsを作成しますconsoleexamplejsconsoleloghelloworldフォルダ構成は下記になります├ーnodemodules├ーpackagejson├ーconsoleexamplejs├ーyarnlock└ーeslintrcjson実行するとメッセージが表示されますnodeconsoleexamplejshelloworldESLintをコマンドラインで利用しますyarneslintconsoleexamplejsUsershayatotempconsoleexamplejserrorconsoleisnotdefinednoundefproblemerrorwarningserrorCommandfailedwithexitcode下記がメッセージの読み方になります行数列数errorwarningエラー内容構文チェックに使用したルールの名称今回はつのエラーが出ましたnoundef宣言されていない変数が使われているか検知するルールですconsoleの変数が認識されていないためエラーが出ています動作環境にあわせてESLintに認識すべきglobal変数を設定しておく必要がありますESLintでは動作する環境ごとに定義されているglobal変数をeslintrcjsonに設定しますenvで動作環境を指定することでglobal変数の指定が出来ます指定可能な変数はESLintのサイトに記載がありますeslintrcjsonextendseslintrecommendedpluginsparserOptionsenvenvbrowsertrueglobalsrules設定内容の説明ですbrowsertrueブラウザで動作するためbrowserを有効化しますこれによりwindowやconsoleなどのglobal変数をESLintが認識できるようになりますESLintをコマンドラインで利用します何もエラーが出ないことを確認しますyarneslintconsoleexamplejsチャレンジエラーメッセージを理解し対処するESLintの動作確認するaddexamplejsを作成しますわざと行目をbではなくcの変数を記載しておきますaddexamplejsfunctionaddabreturnacvarresultaddconsolelogresultフォルダ構成は下記になります├ーnodemodules├ーpackagejson├ーaddexamplejs├ーconsoleexamplejs├ーyarnlock└ーeslintrcjson実行してみる実行時にランタイムエラーになるnodeaddjsUsershayatotempaddexamplejsfunctionaddabreturnacReferenceErrorcisnotdefinedataddUsershayatotempaddexamplejsatObjectltanonymousgtUsershayatotempaddexamplejsatModulecompilenodeinternalmodulescjsloaderatObjectModuleextensionsjsnodeinternalmodulescjsloaderatModuleloadnodeinternalmodulescjsloaderatFunctionModuleloadnodeinternalmodulescjsloaderatFunctionexecuteUserEntryPointasrunMainnodeinternalmodulesrunmainatnodeinternalmainrunmainmoduleESLintをコマンドラインで利用しますyarneslintaddjsUsershayatotempaddexamplejserrorbisdefinedbutneverusednounusedvarserrorcisnotdefinednoundefproblemserrorswarningserrorCommandfailedwithexitcode今回はつのエラーが出ましたnounusedvars宣言されているが使われていない変数があるか検知するルールですbは宣言されているが利用されていないためエラーを出していますnoundef宣言されていない変数が使われているか検知するルールですcは宣言されていないが使われているためエラーを出していますコードを修正しますaddexamplejsfunctionaddabreturnacfunctionaddabreturnabvarresultaddconsolelogresult構文チェックを行いますyarneslintaddexamplejs何もエラーが出ないことを確認しますランタイムエラーが無いことも確認しますnodeaddexamplejsESLintを利用することでランタイムでしか検知できない問題点を事前に把握することができますチャレンジルールを追加して自分の構文チェック環境を構築するESLintの動作確認するcontrolexamplejsを作成しますcontrolexamplejsvarfooiffoofoovarbartruewhilebarbarfalseiffooconsolelogfooelseconsolelognotここでは上記のような統一感の無いコードをESLintの自動修正機能を使って修正して下記のような形に変換しますcontrolexamplejsvarfooiffoofoovarbartruewhilebarbarfalseiffooconsolelogfooelseconsolelognotつのルールを追加しますbracestyleを有効化し、の使い方に統一感をもたせますindentを有効化し、インデントの幅を揃えますspaceinparensを有効化し、内のスペースの利用を統一化します現状のESLintファイルeslintrcjsonの設定を確認しますeslintrcjsonextendseslintrecommendedpluginsparserOptionsenvbrowsertrueglobalsrulesフォルダ構成は下記になります├ーnodemodules├ーpackagejson├ーaddexamplejs├ーconsoleexamplejs├ーcontrolexamplejs├ーyarnlock└ーeslintrcjson構文チェックを行います特にエラーは出ないですyarneslintcontrolexamplejs実行してみますランタイムエラーは起きませんnodecontrolexamplejsfoobracestyleの適応bracestyleを有効化し、下記のようなのスタイルを実現するbracestyle上、下記は正しいですeslintbracestyleerroriffoobarbracestyle上、下記は正しくありませんeslintbracestyleerroriffoobarpackagejsonにbracestyleのルールを追加しますpackagejsonextendseslintrecommendedpluginsparserOptionsenvbrowsertrueglobalsrulesrulesbracestyleerror構文チェックを行いますyarneslintcontrolexamplejsUsershayatotempcontrolexamplejserrorStatementinsideofcurlybracesshouldbeonnextlinebracestyleerrorClosingcurlybraceshouldbeonthesamelineasopeningcurlybraceoronthelineafterthepreviousblockbracestyleerrorStatementinsideofcurlybracesshouldbeonnextlinebracestyleerrorClosingcurlybraceshouldbeonthesamelineasopeningcurlybraceoronthelineafterthepreviousblockbracestyleproblemserrorswarningserrorsandwarningspotentiallyfixablewiththefixoptionつのエラーがでました上のメッセージの中にpotentiallyfixablewiththefixoptionという文言がありますすでに紹介したとおり、ルールによっては自動修正してくれるルールも存在しますbracestyleは自動修正可能なルールなため、コマンドを使って自動修正しますyarneslintfixcontrolexamplejs自動修正されたソースコードは下記になりますcontrolexamplejsvarfooiffoofoovarbartruewhilebarbarfalseiffooconsolelogfooelseconsolelognot構文チェックでエラーが出ないことを確認しておきますyarneslintcontrolexamplejsindentの適応indentを有効化し、インデントの幅を揃えますindent上、下記は正しいですeslintindenterrorifabcfunctionfoodefindent上、下記は正しくありませんeslintindenterrorifabcfunctionfoodefpackagejsonにindentのルールを追加しますpackagejsonextendseslintrecommendedpluginsparserOptionsenvbrowsertrueglobalsrulesbracestyleerrorindenterror構文チェックを行いますyarneslintcontrolexamplejsUsershayatotempcontrolexamplejserrorExpectedindentationofspacesbutfoundindenterrorExpectedindentationofspacesbutfoundindenterrorExpectedindentationofspacesbutfoundindentproblemserrorswarningserrorsandwarningspotentiallyfixablewiththefixoptionerrorCommandfailedwithexitcodeつのエラーがでましたindentは自動修正可能なルールなため、コマンドを使って自動修正しますyarneslintfixcontrolexamplejs自動修正されたソースコードは下記になりますcontrolexamplejsvarfooiffoofoovarbartruewhilebarbarfalseiffooconsolelogfooelseconsolelognot構文チェックでエラーが出ないことを確認しておきますyarneslintcontrolexamplejsspaceinparensの適応spaceinparensを有効化し、、内のスペースの利用を統一化しますspaceinparens上、下記は正しいですeslintspaceinparenserrorfoobarspaceinparens上、下記は正しくありませんeslintspaceinparenserrorfoobarpackagejsonにindentのルールを追加しますpackagejsonextendseslintrecommendedpluginsparserOptionsenvbrowsertrueglobalsrulesbracestyleerrorindenterrorspaceinparenserror構文チェックを行いますyarneslintcontrolexamplejsUsershayatotempcontrolexamplejserrorThereshouldbenospaceafterthisparenspaceinparenserrorThereshouldbenospaceafterthisparenspaceinparensproblemserrorswarningserrorsandwarningspotentiallyfixablewiththefixoptionつのエラーがでましたspaceinparensは自動修正可能なルールなため、コマンドを使って自動修正しますyarneslintfixcontrolexamplejs自動修正されたソースコードは下記になりますcontrolexamplejsvarfooiffoofoovarbartruewhilebarbarfalseiffooconsolelogfooelseconsolelognot構文チェックでエラーが出ないことを確認しておきますyarneslintcontrolexamplejsこのようにyarneslintーfixのコマンドを実行することで自動修正を行うことができますチャレンジnpmscriptsを利用しショートカット作成するpackagejsonファイル内にscriptsにコマンドを記載することで、いちいちコマンドを記載しなくても事項できる環境を作りますpackagejsonにscriptsを追加しますyarnlintで構文チェックのみ行い、yarnlintfixで構文チェックした後に自動修正を行えるようにしますpackagejsonscriptslinteslintjslintfixeslintjsdevDependencieseslint実際に動かしてみますyarnlintUsershayatotempaddexamplejserrorStatementinsideofcurlybracesshouldbeonnextlinebracestyleerrorClosingcurlybraceshouldbeonthesamelineasopeningcurlybraceoronthelineafterthepreviousblockbracestyleproblemserrorswarningserrorsandwarningspotentiallyfixablewiththefixoption構文サンプルで追加したbracestyleに構文サンプルのサンプルコードaddexamplejsが準拠していないと怒られますyarnlintfixで修正しますyarnlintfixaddexamplejsは修正されましたaddexamplejsfunctionaddabreturnabvarresultaddconsolelogresultこのように、ショートカットを利用することで、いちいちコマンド入力しなくても自動修正ができるものは修正可能になります念の為、現時点のpackagejsonを記載しますpackagejsonscriptslinteslintjslintfixeslintfixjsdevDependencieseslinteslintconfigairbnbbaseeslintpluginimport下記は現時点のeslintrcjsonですeslintrcjsonextendseslintrecommendedpluginsparserOptionsenvbrowsertrueglobalsrulesbracestyleerrorindenterrorspaceinparenserrorチャレンジAirbnbのスタイルガイドを適応する自分にあったルールを探して適応させていくのは一苦労ですShareableConfigsで説明しましたが、すでにAirbnbやGoogleがスタイルガイドを公開しているため、それをそのまま利用することで、品質の高いコーディングを実現できます今回はReactベースではないため、eslintconfigairbnbbaseのパケージをインストールします依存関係を解消するためeslintpluginimportもあわせてインストールしますyarnaddDeslintconfigairbnbbaseeslintpluginimportpackagejsonに追加されましたpackagejsonscriptslinteslintjslintfixeslintfixjsdevDependencieseslinteslintconfigairbnbbaseeslintpluginimporteslintrcjsonを修正しeslintconfigairbnbbaseをextendsに追記しています参考までに、記述方法としてeslintconfigは省略が可能ですeslintrcjsonextendsairbnbbasepluginsparserOptionsenvbrowsertrueglobalsrules構文チェックしますyarnlintUsershayatotempaddexamplejserrorAspaceisrequiredaftercommaspacingerrorExpectedindentationofspacesbutfoundindenterrorOperatormustbespacedspaceinfixopserrorTrailingspacesnotallowednotrailingspaceserrorMissingsemicolonsemierrorAllvardeclarationsmustbeatthetopofthefunctionscopevarsontoperrorUnexpectedvaruseletorconstinsteadnovarerrorAspaceisrequiredaftercommaspacingerrorMissingsemicolonsemiwarningUnexpectedconsolestatementnoconsoleerrorNewlinerequiredatendoffilebutnotfoundeollasterrorMissingsemicolonsemiUsershayatotempconsoleexamplejswarningUnexpectedconsolestatementnoconsoleerrorStringsmustusesinglequotequoteserrorNewlinerequiredatendoffilebutnotfoundeollastUsershayatotempcontrolexamplejserrorUnexpectedvaruseletorconstinsteadnovarerrorOperatormustbespacedspaceinfixopserrorMissingsemicolonsemierrorExpectedindentationofspacesbutfoundindenterrorUnaryoperatorusednopluspluserrorMissingsemicolonsemierrorTrailingspacesnotallowednotrailingspaceserrorAllvardeclarationsmustbeatthetopofthefunctionscopevarsontoperrorUnexpectedvaruseletorconstinsteadnovarerrorMissingsemicolonsemierrorExpectedindentationofspacesbutfoundindenterrorOperatormustbespacedspaceinfixopserrorTrailingspacesnotallowednotrailingspaceserrorMissingsemicolonsemierrorTrailingspacesnotallowednotrailingspaceserrorExpectedindentationofspacesbutfoundindentwarningUnexpectedconsolestatementnoconsoleerrorStringsmustusesinglequotequoteserrorExpectedindentationofspacesbutfoundindentwarningUnexpectedconsolestatementnoconsoleerrorStringsmustusesinglequotequoteserrorTrailingspacesnotallowednotrailingspaceserrorNewlinerequiredatendoffilebutnotfoundeollastproblemserrorswarningserrorsandwarningspotentiallyfixablewiththefixoptionerrorCommandfailedwithexitcodeyarnlintfixで修正する前にそれぞれのファイルの内容を記述しておきますaddexamplejsは下記ですaddexamplejsfunctionaddabreturnabvarresultaddconsolelogresultconsoleexamplejsは下記ですconsoleexamplejsconsoleloghelloworldcontrolexamplejsは下記ですcontrolexamplejsvarfooiffoofoovarbartruewhilebarbarfalseiffooconsolelogfooelseconsolelognotはい、めちゃくちゃ怒られましたyarnlintfixで修正しますyarnlintfixUsershayatotempaddexamplejswarningUnexpectedconsolestatementnoconsoleUsershayatotempconsoleexamplejswarningUnexpectedconsolestatementnoconsoleUsershayatotempcontrolexamplejserrorUnaryoperatorusednopluspluswarningUnexpectedconsolestatementnoconsolewarningUnexpectedconsolestatementnoconsoleproblemserrorwarningserrorCommandfailedwithexitcode件まで問題を減らすことができましたメッセージを見る限り、種類のメッセージがあることがわかりますまずは、エラーになっているnoplusplusを修正しますnoplusplusは空白の位置によって解釈が変わるため、やーの利用を禁止するルールです言葉だとわかりにくいのでこういう問題になりますvarivarjijijvarivarjijijcontrolexamplejsを下記の通り修正しましたcontrolexamplejsletfooiffoofoofooletbartruewhilebarbarfalseiffooconsolelogfooelseconsolelognotこれでエラーメッセージは解消できましたyarnlintUsershayatotempaddexamplejswarningUnexpectedconsolestatementnoconsoleUsershayatotempconsoleexamplejswarningUnexpectedconsolestatementnoconsoleUsershayatotempcontrolexamplejswarningUnexpectedconsolestatementnoconsolewarningUnexpectedconsolestatementnoconsoleproblemserrorswarnings次は、つのwarningの対処を行いますJavaScriptはブラウザで利用するように設計されているため、デバッグで記述したと思われるconsoleの利用に対して警告文をnoconsoleでは出しています次の行に対して特定のルールを無効化することができます下記が特定のルールを無効化する記述方法ですeslintdisablenextline無効化したいルール名称無効化したいルール名称を記載しない場合はすべてのルールが無効化されますconsoleexamplejsを修正しましたconsoleexamplejsletfooiffoofooletbartruewhilebarbarfalseiffooeslintdisablenextlinenoconsoleconsolelogfooelseeslintdisablenextlinenoconsoleconsolelognotaddexamplejsも同様に修正しますaddexamplejsfunctionaddabreturnabconstresultaddeslintdisablenextlinenoconsoleconsolelogresultconsoleexamplejsも修正しますが、noconsoleの記載を省略しますこれはすべてのルールを無効化する意味がありますconsoleexamplejseslintdisablenextlineconsoleloghelloworldこれでerrorwarningともに解消できましたyarnlintAirbnbのルールを適応することでいい感じに統一感のあるコーディングが実現できましたチャレンジエディター連携するチャンレジでESLintの基礎知識はだいぶ溜まったと思います最後にエディターと連携させて、実用的な開発環境を整備したいと思いますESLintが連携可能なエディターの情報としては公式サイトに記述があります今回はVisualStudioCode以降VSCodeでの設定を記述しますVSCodeはサイトから取得してPCに設定してください詳細は割愛しますプロジェクトディレクトリに遷移し、codeでVSCodeを開きますcdUsershayatotempcodeVSCodeが開いたら、左下の拡張機能ExtensionsをクリックしてくださいESLintの拡張機能を検索します「eslint」と入力して検索してください検索結果を選択したら、「Install」をクリックして拡張機能のESLintdbaeumervscodeeslintをインストールします動作確認のためifexamplejsのファイルを作成しますifexamplejsvarfooiffoofooフォルダ構成は下記になります├ーnodemodules├ーpackagejson├ーaddexamplejs├ーifexamplejs├ーconsoleexamplejs├ーcontrolexamplejs├ーyarnlock└ーeslintrcjsonESLintでのerrorは赤い波線で、warningは黄色い波線で表示されますVSCodeの設定を変更することで、ソースコードの保存時に自動修正できるようになりますcommandでSettings画面を開く、右上の赤枠をクリックし設定情報をJSONで編集する画面に遷移するsettingsjsonに下記を追加しますsettingsjson保存時にコードアクションを実施editorcodeActionsOnSaveESLintの設定VSCodeではESLintの自動修正をコードアクションとして実行sourcefixAlleslinttrueeditorformatOnSaveとsourcefixAlleslintの設定が競合して正しく自動修正ができなくなることがあるため、保存時にフォーマットは無効化しておくeditorformatOnSavefalsecommandsでソースコードを保存し、保存時にESLintの自動修正を実行するESLintをエディターと連携させることで、コーディングをしながらリアルタイムにlintingできる環境が構築でき、潜在的なバグの早期回収が可能になりました困ったことがあったらESLint公式Discordに質問をすることでサポートを受けることができますわからないことあったらここで聞きましょう日本語のチャンネルもあります日本語の情報収集公式の英語ドキュメントに抵抗がある方は下記でルールが日本語で解説されていますESLintのエラールール。 2021-06-30 18:07:30
js JavaScriptタグが付けられた新着投稿 - Qiita PHPの変数をJavaScriptに渡す方法(Laravel) https://qiita.com/meiyin/items/72261339acd27cd480f1 2021-06-30 18:01:47
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) larave 画像を順番に表示させたい https://teratail.com/questions/346976?rss=all larave画像を順番に表示させたい前提・実現したいことbladephpにforeach文を用い順番に画像を表示させたいです。 2021-06-30 18:47:19
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) pictureタグを使った画像の切り替えを、imgタグ単体で切り替える方法に移行したい https://teratail.com/questions/346975?rss=all pictureタグを使った画像の切り替えを、imgタグ単体で切り替える方法に移行したい前提・実現したいことltpicturegtltsourcemediamaxwidthpxsrcsetforspjpggtltimgsrcfortabjpgalt画像widthheightgtltpicturegt上記のコードで、画面サイズがpx以下はforspjpg、pxサイズ以上でfortabjpgを表示しています。 2021-06-30 18:45:02
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 親テーブルに紐図いてる子テーブルのレコードをすべて表示させたい。 https://teratail.com/questions/346974?rss=all 親テーブルに紐図いてる子テーブルのレコードをすべて表示させたい。 2021-06-30 18:36:23
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) DockerコンテナにSmartyをインストールする方法について https://teratail.com/questions/346973?rss=all DockerコンテナにSmartyをインストールする方法についてDockerを勉強を始めたばかりの者です。 2021-06-30 18:32:43
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) エラー[ error C2672: 'std::construct_at': 一致するオーバーロードされた関数が見つかりませんでした。 ] の解決方法が知りたい。 https://teratail.com/questions/346972?rss=all エラーerrorCxstdconstructatx一致するオーバーロードされた関数が見つかりませんでした。 2021-06-30 18:30:35
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) テンプレートマッチングの不明なエラー https://teratail.com/questions/346971?rss=all 2021-06-30 18:21:32
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) GAS Googleスプレッドシートのチェックボックスを利用したセル範囲保護 https://teratail.com/questions/346970?rss=all GASGoogleスプレッドシートのチェックボックスを利用したセル範囲保護前提・実現したいことGoogleスプレッドシートで、列【BG】【BH】にチェックボックスを行まで設けており、チェックTRUEになると、それに該当する行のみ保護する方法はないでしょうか当方、素人の為、IFprotectと想像してみましたが、結局混乱し形にできませんでした。 2021-06-30 18:21:25
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) python launcherが一瞬で消える https://teratail.com/questions/346969?rss=all プログラムが実行されません実行すると一瞬で消えてしまいます前回、コマンドプロンプトが一瞬で消える現象があり、それはレジストリキーが原因でした。 2021-06-30 18:19:54
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 【Google Apps Script】進捗状況が変わった日付を複数セルに記述したい https://teratail.com/questions/346968?rss=all 【GoogleAppsScript】進捗状況が変わった日付を複数セルに記述したい前提・実現したいこと進捗状況が変わった際のタイムスタンプをGooglenbspAppsnbspScriptで実行できるようにしたいです。 2021-06-30 18:09:30
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) formのinput type=text の初期値にthymeleafから値を格納したい https://teratail.com/questions/346967?rss=all formのinputtypetextの初期値にthymeleafから値を格納したいformのテキストボックスの初期値にthymeleafから値を与えたいspringnbspthymeleafを使ってログインページを製作しています。 2021-06-30 18:09:00
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) pythonのデータフレームを引数とした関数利用について https://teratail.com/questions/346966?rss=all pythonのデータフレームを引数とした関数利用についてpythonのデータフレームを引数として関数利用についてご質問です。 2021-06-30 18:01:08
Linux Ubuntuタグが付けられた新着投稿 - Qiita 【検索して】WSL1とWSL2の共存【なぞっただけ】 https://qiita.com/query1000/items/04409b8e28793a9407d0 つまり、WSLで使用中のと同じバージョンになるが、それでも名前で区別された別のUbuntuとしてWindowsに認識されているっぽい田ボタンをクリックし、StoreとタイプするとMicrosoftStoreが起動するので、Ubuntuで検索した。 2021-06-30 18:32:19
Docker dockerタグが付けられた新着投稿 - Qiita 【docker + vsftpd】複数ネットワークから連続でアップロードを行うと失敗する https://qiita.com/skuromaku/items/a9a2954a225218b23c4d 【dockervsftpd】複数ネットワークから連続でアップロードを行うと失敗するdockerとかよく分からなくて、他社が構築したサーバだったのでダダハマリしたorz事象複数ネットワークから連続でアップロードを行うと失敗する。 2021-06-30 18:22:02
Git Gitタグが付けられた新着投稿 - Qiita 【リファクタリング】コードのにおい(code smell)とは https://qiita.com/Y_M27/items/f99b6595a1f22dd702df 【リファクタリング】コードのにおいcodesmellとはどんな記事新人エンジニアのサクッとアウトプット記事具体的な内容コードというよりはざっくり理解するのが目的リファクタリングとは既存のコードをふるまい動きを変えずに内部の設計をかえること設計コストを小さくでき、保守や拡張の際の工数を減らせる。 2021-06-30 18:29:45
技術ブログ Developers.IO EC2の自動修復方法についてまとめてみた https://dev.classmethod.jp/articles/summarize-automatic-repair-method-of-ec2/ cloudwatch 2021-06-30 09:00:32
海外TECH DEV Community How to navigate and switch components with BrowserRouter https://dev.to/eladossa/how-to-navigate-and-switch-components-with-browserrouter-3k14 How to navigate and switch components with BrowserRouterI want to switch between components after the user enterd the requested info Components that will be shown to user by this order Enter mobile numberID numberCreate PasswordWhen all these steps are completed the broswer will swith to the home page The user must not be able to move between pages until he filled each request Without using React Router I used to switch only two components with conditional rendering and sent askMobile as props this state askMobile true askIndetinfication passed gt if passed this setState askMobile false Now I definitely want a better way with BrowserRouter as if I had components inside Login import React Component from react import BrowserRouter as Router Redirect Route Switch from react router dom import MobileNum from MobileNum jsx import IdentNumber from IdNum jsx import CreatePassword from createPassword jsx class Login extends Component constructor props super props render return lt div gt lt Router gt lt Switch gt lt Route path component MobileNum gt lt Route path component IdNum gt lt Route path component CreatePassword gt lt Switch gt lt Router gt lt div gt export default Login I searched the web in reactrouter com and many others as here for a clean solution but found no answer Any Idea what s the best way to do it Thanks 2021-06-30 09:41:08
海外TECH DEV Community Micro APIs for everyday use https://dev.to/micro/micro-apis-for-everyday-use-2f48 Micro APIs for everyday useHey all Today we re excited to announce our new Micro API cloud platform now in beta Simple fast and affordable APIs for everyday use Signup for free no credit card needed and get of free credit to get started API building blocksMicro has evolved from an open source framework to a full blown API platform one that continues to focus on the developer experience first and foremost The majority of our users are building APIs for end public consumption but having to rebuild many of the building blocks they need wherever they go We wanted to solve that problem by providing a set of programmable building block services as simple APIs for public consumption from anywhere in the world all in one place Some of the APIs we re offering are as follows Cache Ephemeral key value storage Store any data up to mb for fast key based lookup Set TTLs to expire entries so you don t have to remember to delete them DB Simple database service Use CRUD via an API and leave the SQL behind A really dead simple database service which provides JSON document storage Crypto Cryptocurrency prices and quotes Stay up to date with bitcoin ethereum dogecoin and other prices Track them in real time and build any sort of visualisation on top Image Upload resize and crop images Upload images resize on the fly and serve them via a CDN all without having to do anything more than curling our API OTP One time password generation Throwaway the passwords and use one time token generation to login or authenticate users Simple OTP generation and validation Routing Turn by turn directions and etas A vastly cheaper Google Maps API alternative powered by OSRM We ll give you turn by turn routing directions and etas using OpenStreetMap data Third Party APIsAdditionally we ve partnered with third party API providers such as Finage ExchangeRate API and the WeatherAPI to bring more functionality to the platform like Currency conversion Stock prices and Weather forecasts so you can access everything you need with just one account and one API key all in one place We re adding more and more third party API providers everyday so keep your eyes peeled Taming ComplexityAWS is the cloud giant in the sky we ve all come to know as the definition of API building blocks but over time it s complexity has also grown making it more and more difficult to work with as a developer We see this we feel this and we know there needs to be a change Micro attempts to remove the marketing spiel cloud complexity and bottomless billing by doing the following API docs and usage are always just one click awayBilling is Top Up only Only use the credit in your accountEverything can be accessed via Curl or any simple HTTP libraryHere s some of what we re talking about API docs provide examples and usage along with the pricing clearly next to the endpointTest out the API right there in the UIWe ll add free credit to your account to start but just top up with however much you needThen just head to the token page to create yourself a well scoped token for external useAnd finally Curl it from anywhere curl H Content Type application json H Authorization Bearer MICRO API TOKEN d type snowflake Thanks for readingHopefully you buy into what we re talking about and the need for something new in the API space If you like what you re hearing Signup for Free or send us some feedback Reach out on slack or twitter if you have any questions 2021-06-30 09:38:11
海外TECH DEV Community Applozic Android SDK Tutorial 3 - Chat Conversations https://dev.to/applozic/applozic-android-sdk-tutorial-3-chat-conversations-2e7c Applozic Android SDK Tutorial Chat Conversations IntroductionThis tutorial is Part of a multi part series covering Applozic Android SDK integration into an Android app Our goal is to learn the following steps in this tutorial Launch Conversation list screenCreate individual chat threadCreate group chat threadCreate context based chat threadDelete chat threadsYou can download the sample Android chat app from Applozic GitHub Conversation screenTo give you an idea of what the conversation screen would look like in the final app take a look at the screenshot below Android Conversation screenTo get started with such a conversation screen add the following code Intent intent new Intent this ConversationActivity class startActivity intent You can set this to activate as soon as the user opens the conversation screen Individual ChatFrom the main conversation screen the user can choose to launch either an individual conversation thread or a group chat thread An individual chat screen will look like this Individual chat screenFor starting individual conversation thread set userId in intent Intent intent new Intent this ConversationActivity class intent putExtra ConversationUIService USER ID receiveruserid intent putExtra ConversationUIService DISPLAY NAME Receiver display name to display the title intent putExtra ConversationUIService TAKE ORDER true Skip chat list on back press startActivity intent Group ChatA group conversation contains multiple users that can send and receive messages Internally a group conversation is referred to as a channel Applozic supports multiple group types that serve different purposes ValueNameDescriptionPrivate GroupPrivate groups are not accessible to contacts other than the ones present in the group Only group admin can add remove members in the group You can create private groups to facilitate close WhatsApp style interactions For example doctor patient chats Public GroupUsers will be able to search and join Public groups Any group member can add remove members in this group For example Public groups can be used to create area wise communities in a social app where users can search their area s community and join Broadcast GroupA message can be sent to several contacts at once Messages sent in the broadcast group are received by the members of the group as one to one chat thread Only the sender can see the broadcast group The broadcast group works on a similar behavior as that of WhatsApp broadcasts Open GroupUsed for free flowing chats such as live streaming chats live event chats etc You need not add any members to this group All users present on the chat screen will receive messages via MQTT publish subscribe pattern Push notifications are not supported in Open groups GroupOfTwoUsed for the purpose where dealers are selling products and any particular user wants to chat about multiple products with the same dealer At that time it is required to show two different chat threads in the conversation history as the context product of the chats is different Contacts GroupUsed for creating Friends Favorites contact List These lists can be maintained on the application level and any member of the group can access it For example an event management company can use the lists to maintain attendees of an event at one place Support GroupBest suited for people who want to use Applozic s sister product  Kommunicate These groups are specifically built for the purpose of customer support chat and may contain multiple team members and chatbots talking to a user Table showcasing different group types Continue this Tutorial on Applozic Blog We have the detailed tutorial with code snippets available on our blog for you to continue with your integration Click here to learn how to Create a group chat threadCreate a context based chat threadDelete chat threads 2021-06-30 09:32:10
Apple AppleInsider - Frontpage News Apple continues with return to work plan, denies staff requests to reconsider https://appleinsider.com/articles/21/06/30/apple-continues-with-return-to-work-plan-denies-staff-requests-to-reconsider?utm_medium=rss Apple continues with return to work plan denies staff requests to reconsiderApple is reportedly sticking to its plan that workers return to Apple Park and other officers beginning in September Apple ParkA new internal Apple memo suggests that the company is not backing down from its decision that staff must return to work on Mondays Tuesdays and Thursdays from September Wednesdays and Friday appear to remain as optional working from home days Read more 2021-06-30 09:47:43
海外TECH Engadget AirCar prototype completes its first inter-city flight https://www.engadget.com/aircar-first-inter-city-flight-092852060.html?src=rss AirCar prototype completes its first inter city flightThe term flying car is a bit of a misnomer In order to meet regulatory guidelines many of the vehicles currently in development are more like manned drones or vertical take off and landing aircraft VTOL But a prototype that just achieved a major milestone actually fits the flying car description nbsp A Slovakian company known as Klein Vision recently completed its inaugural inter city flight between the Nitra and Bratislava airports At the end of the minute journey the vehicle s inventor professor Stefan Klein clicked a button to tuck in its wings and drove the car home straight from the tarmac The company has been working on its hybrid aircraft for more than years With successful landings and over hours of test flights under its belt Klein is convinced that his third prototype is ready to leap past the concept stage As part of its latest breakthrough the two seater AirCar reached a cruising speed of km h slightly below the max km h Klein says the car has flown at ft and achieved steep degree turns as part of its maneuverability testing Unlike VTOL vehicles the AirCar requires a runway for takeoff and landing The current prototype is equipped with a HP BMW engine with a fixed propeller and a ballistic parachute Klein has even bigger plans for its follow up He claims the HP pre production model will receive the CS aircraft certification for normal utility aerobatic and commuter aeroplanes from European aviation regulators along with an M road permit In reality getting there could still prove a challenge The company will have to tread a fine line between a light aircraft and a more substantial vehicle with health and safety precautions built in However there are signs that regulators are coming round to the idea of flying cars In the US the Federal Aviation Authority recently granted Terrafugia s roadable airplane a special certificate in the light sport category S LSA making it legal for flight 2021-06-30 09:28:52
海外ニュース Japan Times latest articles New COVID-19 cases in Tokyo top 700 for first time since May 26 https://www.japantimes.co.jp/news/2021/06/30/national/japan-coronavirus-june30/ previous 2021-06-30 18:20:35
ニュース BBC News - Home Euro 2020: England focus turns to Ukraine for quarter-finals https://www.bbc.co.uk/sport/football/57660584 covid 2021-06-30 09:53:52
ニュース BBC News - Home Canada weather: Dozens dead as heatwave shatters records https://www.bbc.co.uk/news/world-us-canada-57654133 temperature 2021-06-30 09:45:26
ビジネス ダイヤモンド・オンライン - 新着記事 サムティ(3244)、5期連続となる「増配」を発表し、 配当利回り4%超に! 年間配当は5年で2.9倍に増加、 2021年11月期は前期比4円増の「1株あたり86円」に! - 配当【増配・減配】最新ニュース! https://diamond.jp/articles/-/275570 サムティ、期連続となる「増配」を発表し、配当利回り超に年間配当は年で倍に増加、年月期は前期比円増の「株あたり円」に配当【増配・減配】最新ニュースサムティが、年月期の配当予想の修正増配を発表し、配当利回りがにサムティは、年月期の年間配当を前回予想比で「円」の増配、前期比では「円」の増配となる「株あたり円」に修正すると発表した。 2021-06-30 18:48:00
ビジネス 不景気.com T&K TOKAが欧州子会社を解散、印刷市場の低迷で - 不景気.com https://www.fukeiki.com/2021/06/tk-toka-liquidate-rdpif.html tktoka 2021-06-30 09:45:18
GCP Google Cloud Platform Japan 公式ブログ 上位 25 件の Google 検索キーワードが BigQuery で利用可能に https://cloud.google.com/blog/ja/products/data-analytics/top-25-google-search-terms-now-in-bigquery/ GoogleトレンドデータにアクセスできるのはGoogleトレンドのウェブサイトに限られており、基礎となるダッシュボードデータをエクスポートして追加の分析情報を引き出すには手作業による処理が必要です。 2021-06-30 11:00:00
北海道 北海道新聞 ジョブアンテナ北海道 1日開設 求人マッチングサイト https://www.hokkaido-np.co.jp/article/561709/ 道新グループ 2021-06-30 18:17:30
北海道 北海道新聞 幼稚園バスにはねられ小1けが 岐阜、下校中に交差点で https://www.hokkaido-np.co.jp/article/561724/ 幼稚園バス 2021-06-30 18:13:00
北海道 北海道新聞 東海、関東甲信中心に大雨の恐れ 2日にかけて前線停滞 https://www.hokkaido-np.co.jp/article/561718/ 梅雨前線 2021-06-30 18:09:53
北海道 北海道新聞 新小結の明生「すごく新鮮」 名古屋場所へ漂う充実感 https://www.hokkaido-np.co.jp/article/561722/ 名古屋場所 2021-06-30 18:08:00
北海道 北海道新聞 駅で女性見張り疑いの男逮捕 ストーカー改正法の初適用 https://www.hokkaido-np.co.jp/article/561721/ 兵庫県警 2021-06-30 18:04:00
北海道 北海道新聞 五輪規則集の改定要求 枝野氏「例外あり得ない」 https://www.hokkaido-np.co.jp/article/561719/ 東京五輪 2021-06-30 18:01:00
北海道 北海道新聞 元G大阪の黄義助ら選出 韓国の五輪男子サッカー https://www.hokkaido-np.co.jp/article/561717/ 東京五輪 2021-06-30 18:01:00
IT 週刊アスキー 駅伝スタイルで2ヵ月ごとに名店が登場「マンスリーどんぶりキッチン丼’s」、あみプレミアム・アウトレットにて7月3日より提供開始 https://weekly.ascii.jp/elem/000/004/061/4061016/ 提供開始 2021-06-30 18:40:00
IT 週刊アスキー ソフトバンク、7月上旬~8月下旬に富士山頂の一部エリアで「SoftBank 5G」を提供 https://weekly.ascii.jp/elem/000/004/061/4061017/ softbankg 2021-06-30 18:40:00
IT 週刊アスキー 『リゼロス』ガーフィールが登場するガチャが新登場!レベルの上限解放も実施 https://weekly.ascii.jp/elem/000/004/061/4061004/ lostinmemories 2021-06-30 18:35:00
IT 週刊アスキー ドコモ、ソニーの新フラッグシップ「Xperia 1 III」を7月9日に発売 https://weekly.ascii.jp/elem/000/004/061/4061015/ xperia 2021-06-30 18:30:00
IT 週刊アスキー オリジナルグッズがゲットできる!『英雄伝説 黎の軌跡』×「立川あにきゃん」のコラボキャンペーンを開催決定 https://weekly.ascii.jp/elem/000/004/061/4061006/ 日本ファルコム 2021-06-30 18:10:00
GCP Cloud Blog JA 上位 25 件の Google 検索キーワードが BigQuery で利用可能に https://cloud.google.com/blog/ja/products/data-analytics/top-25-google-search-terms-now-in-bigquery/ GoogleトレンドデータにアクセスできるのはGoogleトレンドのウェブサイトに限られており、基礎となるダッシュボードデータをエクスポートして追加の分析情報を引き出すには手作業による処理が必要です。 2021-06-30 11:00:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)