{"id":1187,"date":"2024-10-26T07:23:36","date_gmt":"2024-10-26T07:23:36","guid":{"rendered":"https:\/\/aki-hamano.blog\/?p=1187"},"modified":"2025-10-25T03:52:35","modified_gmt":"2025-10-25T03:52:35","slug":"introduce-eslint-to-the-block-development","status":"publish","type":"post","link":"https:\/\/aki-hamano.blog\/ja\/2024\/10\/26\/introduce-eslint-to-the-block-development\/","title":{"rendered":"\u30d6\u30ed\u30c3\u30af\u958b\u767a\u306b ESLint \u3092\u5c0e\u5165\u3057\u3066\u307f\u3088\u3046"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001WordPress \u30d6\u30ed\u30c3\u30af\u958b\u767a\u306b\u304a\u3051\u308b JavaScript \u306e\u30b3\u30fc\u30c9\u54c1\u8cea\u6539\u5584\u3001\u304a\u3088\u3073\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb\u7d71\u4e00\u306e\u305f\u3081\u306b\u3001ESLint \u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ESLint \u3092\u5c0e\u5165\u3059\u308b\u7406\u7531<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30ab\u30c3\u30b3\u6587\u5b57\u306e\u524d\u5f8c\u306b\u30b9\u30da\u30fc\u30b9\u304c\u3044\u304f\u3064\u3042\u3063\u3066\u3082\u3001\u3069\u3053\u3067\u6539\u884c\u3057\u3066\u3082\u3001\u3069\u306e\u3088\u3046\u306a\u5909\u6570\u540d\u3067\u3042\u3063\u3066\u3082\u3001\u30b3\u30fc\u30c9\u304c\u5168\u3066\u6b63\u3057\u3051\u308c\u3070\u3001\u30d6\u30ed\u30c3\u30af\u306f\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u307e\u3059\u3002\u30d6\u30e9\u30a6\u30b6\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u4f55\u306e\u8b66\u544a\u3084\u30a8\u30e9\u30fc\u3082\u8868\u793a\u3055\u308c\u306a\u3044\u3067\u3057\u3087\u3046\u3002\u305d\u306e\u30b3\u30fc\u30c9\u3092\u81ea\u5206\u3060\u3051\u3057\u304b\u8aad\u3080\u3053\u3068\u304c\u306a\u304f\u3001\u3069\u3053\u306b\u3082\u516c\u958b\u3057\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u305d\u308c\u306f\u554f\u984c\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3067\u3059\u304c\u3001\u305d\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092 GitHub \u306a\u3069\u306b\u516c\u958b\u3057\u305f\u5834\u5408\u3001\u8ab0\u304b\u304c\u305d\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u8208\u5473\u3092\u6301\u3061\u3001\u30b3\u30fc\u30c9\u3092\u8aad\u3093\u3060\u308a\u3001\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u307e\u305f\u4e00\u3064\u306e\u30d6\u30ed\u30c3\u30af\u306b\u8907\u6570\u306e\u958b\u767a\u8005\u304c\u95a2\u308f\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u81ea\u5206\u4ee5\u5916\u306e\u958b\u767a\u8005\u304c\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3092\u76ee\u306b\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u306e\u3088\u3046\u306a\u6642\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30eb\u30fc\u30eb\u304c\u7d71\u4e00\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u3089\u3069\u3046\u611f\u3058\u308b\u3067\u3057\u3087\u3046\u304b\u3002\u8aad\u307f\u306b\u304f\u3044\u3068\u611f\u3058\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3057\u3001\u4e0d\u5177\u5408\u6df7\u5165\u306e\u539f\u56e0\u306b\u306a\u308b\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d6\u30ed\u30c3\u30af\u306e\u3072\u306a\u5f62\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ESLint \u306b\u95a2\u3057\u3066\u8aac\u660e\u3059\u308b\u524d\u306b\u3001\u307e\u305a\u306f\u30d6\u30ed\u30c3\u30af\u306e\u3072\u306a\u5f62\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002\u81ea\u5206\u3067\u4e00\u3064\u4e00\u3064\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001<code>@wordpress\/create-block<\/code> \u3068\u3044\u3046\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u3072\u306a\u5f62\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code>npx @wordpress\/create-block gutenpride<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>gutenpride<\/code> \u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u958b\u304f\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"330\" height=\"643\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-file-structure.png\" alt=\"create-block \u306b\u3088\u3063\u3066\u4f5c\u6210\u3055\u308c\u308b\u30d5\u30a1\u30a4\u30eb\" class=\"wp-image-1190\" style=\"object-fit:cover\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">EditorConfig<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d5\u30a1\u30a4\u30eb\u69cb\u6210\u3092\u898b\u308b\u3068\u3001<code>.editorconfig<\/code> \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002ESLint \u3092\u5c0e\u5165\u3059\u308b\u524d\u306b\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb\u3092\u7d71\u4e00\u3059\u308b\u305f\u3081\u306b\u3082\u3046\u4e00\u3064\u91cd\u8981\u306a\u8a2d\u5b9a\u3067\u3042\u308b EditorConfig \u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">EditorConfig \u3092\u5c0e\u5165\u3059\u308b\u7406\u7531\u306e\u4e00\u3064\u3068\u3057\u3066\u3001\u6b21\u306e\u3088\u3046\u306a\u4f8b\u3092\u6319\u3052\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e00\u3064\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u8907\u6570\u306e\u958b\u767a\u8005\u304c\u95a2\u308f\u3063\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u958b\u767a\u8005A\u306f\u3001\u81ea\u8eab\u306e\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u30012\u3064\u306e\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u30a4\u30f3\u30c7\u30f3\u30c8\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u958b\u767a\u8005B\u306f\u3001\u81ea\u8eab\u306e\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u3001\u30bf\u30d6\u3092\u30a4\u30f3\u30c7\u30f3\u30c8\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u5e45\u306f4\u6587\u5b57\u5206\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u958b\u767a\u8005A\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u305f\u3068\u3057\u307e\u3059\u3002\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u5168\u3066\u30b9\u30da\u30fc\u30b9\u3067\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"256\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent-840x256.png\" alt=\"2\u30b9\u30da\u30fc\u30b9\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u6301\u3064\u30b3\u30fc\u30c9\" class=\"wp-image-1205\" srcset=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent-840x256.png 840w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent-768x234.png 768w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent.png 1077w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30b3\u30fc\u30c9\u304c\u66f8\u304b\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u3001\u958b\u767a\u8005B\u304c\u81ea\u8eab\u306e\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u3067\u958b\u304d\u300134\u884c\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u524a\u9664\u3057\u3001<em>\u8996\u899a\u7684\u306b<\/em>\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u6b63\u3057\u304f\u306a\u308b\u3088\u3046\u306b\u518d\u8abf\u6574\u3057\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"201\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-tab-indent-840x201.png\" alt=\"\u4e00\u90e8\u306b\u30bf\u30d6\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u6301\u3064\u30b3\u30fc\u30c9\" class=\"wp-image-1203\" srcset=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-tab-indent-840x201.png 840w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-tab-indent-768x184.png 768w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-tab-indent.png 913w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3057\u304b\u3057\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u767a\u8005A\u304c\u518d\u5ea6\u958b\u304f\u3068\u300134\u884c\u76ee\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u8996\u899a\u7684\u306b\u6b63\u3057\u304f\u306a\u3044\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"247\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent-with-tab-840x247.png\" alt=\"\u4e00\u90e8\u306b\u30bf\u30d6\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u6301\u3064\u30b3\u30fc\u30c9\" class=\"wp-image-1204\" srcset=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent-with-tab-840x247.png 840w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent-with-tab-768x226.png 768w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-space-indent-with-tab.png 1076w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u306b\u3088\u3063\u3066\u306f\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u5168\u3066\u306e\u958b\u767a\u8005\u306e\u9593\u3067\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u8996\u899a\u7684\u306b\u305d\u308d\u3046\u4e8b\u306f\u5fc5\u305a\u3057\u3082\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u3088\u3046\u306a\u5dee\u7570\u3092\u9632\u304e\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb\u3092\u4e00\u3064\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u7d71\u4e00\u3059\u308b\u4e8b\u304c\u3001EditorConfig&nbsp;\u3092\u5c0e\u5165\u3059\u308b\u4e00\u3064\u306e\u7406\u7531\u3067\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">EditorConfig \u306f\u3001\u975e\u5e38\u306b\u591a\u304f\u306e\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3044\u304f\u3064\u304b\u306e\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u3067\u306f\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5c0e\u5165\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u81ea\u8eab\u306e\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u3067\u8ffd\u52a0\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u304b\u3069\u3046\u304b\u306f\u3001\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/editorconfig.org\/#pre-installed\" target=\"_blank\" rel=\"noreferrer noopener\">EditorConfig &#8211; No Plugin Necessary<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/editorconfig.org\/#download\" target=\"_blank\" rel=\"noreferrer noopener\">EditorConfig &#8211; Download a Plugin<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">create-block \u306eEditorConfig<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u3001create-block \u306b\u3088\u3063\u3066\u4f5c\u6210\u3055\u308c\u305f <code>.editorconfig<\/code> \u306e\u8a2d\u5b9a\u3092\u898b\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre data-label=\".editorconfig\" id=\".editorconfig\" class=\"wp-block-code lang-editorconfig\"><code># This file is for unifying the coding style for different editors and IDEs\n# editorconfig.org\n\n# WordPress Coding Standards\n# https:\/\/make.wordpress.org\/core\/handbook\/coding-standards\/\n\nroot = true\n\n&#91;*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\nindent_style = tab\n\n&#91;*.{yml,yaml}]\nindent_style = space\nindent_size = 2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8a2d\u5b9a\u5185\u5bb9\u3092\u898b\u308b\u3068\u3001\u4f8b\u3048\u3070\u524d\u8ff0\u3057\u305f\u30a4\u30f3\u30c7\u30f3\u30c8\u30eb\u30fc\u30eb\u306b\u95a2\u3057\u3066\u306f\u3001\u300c\u30bf\u30d6\u30a4\u30f3\u30c7\u30f3\u30c8\u300d\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u3092\u81ea\u5206\u306e\u597d\u307f\u306b\u5408\u308f\u305b\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u91cd\u8981\u306a\u3053\u3068\u306f\u300c<strong>\u305d\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u3001\u30eb\u30fc\u30eb\u306b\u57fa\u3065\u3044\u3066\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb\u304c\u7d71\u4e00\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b<\/strong>\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ESLint \u3092\u5c0e\u5165\u3059\u308b\u524d\u306b\u3001\u307e\u305a\u306f EditorConfig \u306b\u3088\u308b\u30eb\u30fc\u30eb\u3092\u5b9a\u7fa9\u3059\u308b\u4e8b\u3092\u5f37\u304f\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript \u30b3\u30fc\u30c9\u3092 ESlint \u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067 ESLint \u306e\u8a71\u306b\u623b\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30d6\u30ed\u30c3\u30af\u306e <code>Edit<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u304a\u3044\u3066\u3001\u30d6\u30ed\u30c3\u30af\u304c\u8868\u793a\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u3092\u4e00\u5ea6 <code>my_variable<\/code> \u5909\u6570\u306b\u683c\u7d0d\u3059\u308b\u3088\u3046\u306b\u66f4\u65b0\u3057\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>export default function Edit() {\n\tconst my_variable = __( 'Gutenpride \u2013 hello from the editor!', 'gutenpride' );\n\treturn (\n\t\t&lt;p { ...useBlockProps() }>\n\t\t\t{ my_variable }\n\t\t&lt;\/p>\n\t);\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">create-block \u3067\u30d6\u30ed\u30c3\u30af\u306e\u3072\u306a\u5f62\u3092\u4f5c\u6210\u3057\u305f\u5834\u5408\u3001ESLint \u306b\u3088\u3063\u3066\u3053\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5185\u5305\u3055\u308c\u3066\u3044\u307e\u3059\u3002<code>package.json<\/code> \u306e <code>scripts<\/code> \u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b<code>lint:js<\/code> \u3068\u3044\u3046\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code>npm run lint:js<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u3092\u78ba\u8a8d\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"184\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error-840x184.png\" alt=\"lint:js \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u5f8c\u306b\u8868\u793a\u3055\u308c\u308b\u30a8\u30e9\u30fc\" class=\"wp-image-1307\" srcset=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error-840x184.png 840w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error-768x168.png 768w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error.png 1474w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30a8\u30e9\u30fc\u304b\u3089\u3001\u66f8\u304b\u308c\u305f\u30b3\u30fc\u30c9\u304c\u4ee5\u4e0b\u4e8c\u3064\u306e\u30eb\u30fc\u30eb\u306b\u6e96\u3058\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>my_variable<\/code> \u3068\u3044\u3046\u5909\u6570\u540d\u304c<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E3%82%AD%E3%83%A3%E3%83%A1%E3%83%AB%E3%82%B1%E3%83%BC%E3%82%B9\" target=\"_blank\" rel=\"noreferrer noopener\">\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9<\/a>\u3067\u306f\u306a\u3044<\/li>\n\n\n\n<li>\u6539\u884c\u3084\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u9069\u5207\u3067\u306f\u306a\u3044<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Lint \u30a8\u30e9\u30fc\u3092\u81ea\u52d5\u7684\u306b\u4fee\u6b63\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u308c\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u30a8\u30e9\u30fc\u3092\u89e3\u6d88\u3059\u308b\u305f\u3081\u306b\u3001\u5168\u3066\u624b\u52d5\u3067\u4fee\u6b63\u3057\u3001\u30a8\u30e9\u30fc\u304c\u89e3\u6d88\u3055\u308c\u308b\u307e\u3067 <code>lint:js<\/code> \u3092\u4f55\u5ea6\u3082\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>lint:js<\/code> \u3068\u540c\u69d8\u306b\u3001create-block \u306b\u306f\u3001\u3053\u306e\u30a8\u30e9\u30fc\u3092\u3042\u308b\u7a0b\u5ea6\u81ea\u52d5\u7684\u306b\u4fee\u6b63\u3059\u308b\u305f\u3081\u306e <code>format<\/code> \u30b9\u30af\u30ea\u30d7\u30c8\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code>$ npm run format\n\n&gt; gutenpride@0.1.0 format\n&gt; wp-scripts format\n\npackage-lock.json 129ms\npackage.json 1ms\nsrc\/block.json 5ms\nsrc\/edit.js 10ms\nsrc\/index.js 3ms\nsrc\/save.js 2ms\nsrc\/view.js 2ms<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u8b66\u544a\u3055\u308c\u305f\u4e8c\u3064\u306e\u30a8\u30e9\u30fc\u306e\u3046\u3061\u3001\u6539\u884c\u3084\u30a4\u30f3\u30c7\u30f3\u30c8\u306b\u95a2\u3059\u308b\u30a8\u30e9\u30fc\u304c\u81ea\u52d5\u7684\u306b\u4fee\u6b63\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>export default function Edit() {\n\tconst my_variable = __(\n\t\t'Gutenpride \u2013 hello from the editor!',\n\t\t'gutenpride'\n\t);\n\treturn &lt;p { ...useBlockProps() }>{ my_variable }&lt;\/p>;\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Lint \u30a8\u30e9\u30fc\u3092\u624b\u52d5\u3067\u4fee\u6b63\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u305f\u3060\u3057\u3001\u5909\u6570\u540d\u306b\u95a2\u3059\u308b\u30a8\u30e9\u30fc\u306f\u81ea\u52d5\u7684\u306b\u4fee\u6b63\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<code>format<\/code> \u30b3\u30de\u30f3\u30c9\u306f\u3001\u5168\u3066\u306e\u30a8\u30e9\u30fc\u3092\u81ea\u52d5\u3067\u4fee\u6b63\u3059\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u305f\u3081\u3001\u6b8b\u3063\u305f\u30a8\u30e9\u30fc\u306f\u624b\u52d5\u3067\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u5909\u6570\u540d\u3092\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9 (<code>myVariable<\/code>) \u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>export default function Edit() {\n\tconst myVariable = __(\n\t\t'Gutenpride \u2013 hello from the editor!',\n\t\t'gutenpride'\n\t);\n\treturn &lt;p { ...useBlockProps() }>{ myVariable }&lt;\/p>;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>npm run lint:js<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5168\u3066\u306e\u30a8\u30e9\u30fc\u304c\u89e3\u6d88\u3055\u308c\u305f\u4e8b\u3092\u78ba\u8a8d\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u3053\u308c\u3089\u306e ESLint \u30eb\u30fc\u30eb\u306f\u3069\u3053\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u81ea\u5206\u3067 ESLint \u306e\u305f\u3081\u306e\u30eb\u30fc\u30eb\u3092\u5168\u304f\u5b9a\u7fa9\u3057\u3066\u3044\u306a\u3044\u306b\u3082\u304b\u304b\u308f\u3089\u305a\u3001\u3042\u308b\u30eb\u30fc\u30eb\u306b\u57fa\u3065\u3044\u3066\u30b3\u30fc\u30c9\u304c\u89e3\u6790\u3055\u308c\u308b\u7406\u7531\u306f\u306a\u3093\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u308c\u306f\u3001create-block \u306b\u3088\u3063\u3066\u30d5\u30a1\u30a4\u30eb\u306e\u3072\u306a\u5f62\u304c\u4f5c\u6210\u3055\u308c\u308b\u6642\u306b\u3001<code>@wordpress\/scripts<\/code> \u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001\u305d\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u4f9d\u5b58\u3057\u3066\u3044\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u306b ESLint \u30eb\u30fc\u30eb\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002\u305d\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f <code>@wordpress\/eslint-plugin<\/code> \u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>npm ls<\/code> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3067\u3001 <code>@wordpress\/scripts<\/code> \u304c <code>@wordpress\/eslint-plugin<\/code> \u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code>$ npm ls @wordpress\/eslint-plugin\ngutenpride@0.1.0 \/home\/username\/projects\/gutenpride\n\u2514\u2500\u252c @wordpress\/scripts@30.3.0\n  \u2514\u2500\u2500 @wordpress\/eslint-plugin@21.3.0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>lint:js<\/code>\u3001\u3064\u307e\u308a <code>wp-scripts lint-js<\/code> \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<code>@wordpress\/eslint-plugin<\/code>\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30eb\u30fc\u30eb\u306b\u57fa\u3065\u3044\u3066\u30b3\u30fc\u30c9\u304c\u89e3\u6790\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ESLint \u305d\u306e\u3082\u306e\u306b\u3064\u3044\u3066\u3082\u3001\u4f9d\u5b58\u95a2\u4fc2\u3068\u3057\u3066\u5b58\u5728\u3057\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code>$ npm ls eslint\ngutenpride@0.1.0 \/home\/username\/projects\/gutenpride\n\u2514\u2500\u252c @wordpress\/scripts@30.3.0\n  \u251c\u2500\u252c @wordpress\/eslint-plugin@21.3.0\n  \u2502 \u251c\u2500\u252c @babel\/eslint-parser@7.25.7\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c @typescript-eslint\/eslint-plugin@6.21.0\n  \u2502 \u2502 \u251c\u2500\u252c @typescript-eslint\/type-utils@6.21.0\n  \u2502 \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u2502 \u251c\u2500\u252c @typescript-eslint\/utils@6.21.0\n  \u2502 \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c @typescript-eslint\/parser@6.21.0\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-config-prettier@8.10.0\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-import@2.31.0\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-jest@27.9.0\n  \u2502 \u2502 \u251c\u2500\u252c @typescript-eslint\/utils@5.62.0\n  \u2502 \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-jsdoc@46.10.1\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-jsx-a11y@6.10.1\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-playwright@0.15.3\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-prettier@5.2.1\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-react-hooks@4.6.2\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u251c\u2500\u252c eslint-plugin-react@7.37.2\n  \u2502 \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2502 \u2514\u2500\u2500 eslint@8.57.1 deduped\n  \u2514\u2500\u252c eslint@8.57.1\n    \u2514\u2500\u252c @eslint-community\/eslint-utils@4.4.1\n      \u2514\u2500\u2500 eslint@8.57.1 deduped<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">ESLint \u30eb\u30fc\u30eb\u3092\u62e1\u5f35\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30eb\u30fc\u30eb\u3060\u3051\u306b\u57fa\u3065\u3044\u3066\u958b\u767a\u3092\u9032\u3081\u308b\u4e8b\u3082\u3082\u3061\u308d\u3093\u53ef\u80fd\u3067\u3059\u3002\u3067\u3059\u304c\u3001\u4e00\u90e8\u306e\u30eb\u30fc\u30eb\u3092\u81ea\u5206\u306e\u597d\u307f\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3057\u305f\u3044\u3001\u307e\u305f\u306f\u3088\u308a\u53b3\u683c\u306a\u30eb\u30fc\u30eb\u3092\u9069\u7528\u3057\u305f\u3044\u3068\u3044\u3046\u4eba\u3082\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30eb\u30fc\u30eb\u3092\u5909\u66f4\u307e\u305f\u306f\u62e1\u5f35\u3059\u308b\u305f\u3081\u306b\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b <code>.eslintrc<\/code> \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u4e2d\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre data-label=\".eslintrc\" id=\".eslintrc\" class=\"wp-block-code lang-json\"><code>{\n\t\"extends\": &#91; \"plugin:@wordpress\/eslint-plugin\/recommended\" ]\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>lint:js<\/code> \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u3053\u3053\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30eb\u30fc\u30eb\u306b\u57fa\u3065\u304d\u30b3\u30fc\u30c9\u304c\u89e3\u6790\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u65e2\u5b58\u306e\u30eb\u30fc\u30eb\u3092\u5909\u66f4\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e2\u5b58\u306e\u30eb\u30fc\u30eb\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306b\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u3048\u3070\u3001<code>__experimental<\/code> \u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u304c\u4ed8\u3044\u305f API \u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6ce8\u610f: \u3053\u308c\u306f\u4f8b\u3067\u3042\u308a\u3001<code>@wordpress\/foo<\/code> \u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3001\u304a\u3088\u3073 <code>__experimentalFeature<\/code> \u3068\u3044\u3046 API \u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>import { __experimentalFeature } from '@wordpress\/foo';\n\nexport default function Edit() {\n\tconst myVariable = __(\n\t\t'Gutenpride \u2013 hello from the editor!',\n\t\t'gutenpride'\n\t);\n\treturn &lt;p { ...useBlockProps() }&gt;{ myVariable }&lt;\/p&gt;;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>lint:js<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u4e8c\u3064\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"136\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error-experimental-feature-840x136.png\" alt=\"lint:js \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u5f8c\u306b\u8868\u793a\u3055\u308c\u308b\u3001\u5b9f\u9a13\u7684\u306a API \u306b\u95a2\u3059\u308b\u30a8\u30e9\u30fc\" class=\"wp-image-1241\" srcset=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error-experimental-feature-840x136.png 840w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error-experimental-feature-768x124.png 768w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/lint-error-experimental-feature.png 1477w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u4e8c\u3064\u306e\u30a8\u30e9\u30fc\u306e\u3046\u3061\u3001\u300cUsage of <code>__experimentalFeature<\/code> from <code>@wordpress\/foo<\/code> is not allowed.\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30eb\u30fc\u30eb\u306f <code>@wordpress\/eslint-plugin<\/code> \u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30eb\u30fc\u30eb\u3067\u3042\u308a\u3001\u305d\u306e\u30eb\u30fc\u30eb\u306e\u8a73\u7d30\u306f<a href=\"https:\/\/github.com\/WordPress\/gutenberg\/blob\/trunk\/packages\/eslint-plugin\/docs\/rules\/no-unsafe-wp-apis.md\" target=\"_blank\" rel=\"noreferrer noopener\">\u3053\u306e README<\/a> \u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30eb\u30fc\u30eb\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u7121\u52b9\u5316\u3059\u308b\u305f\u3081\u306b\u3001<code>.eslintrc<\/code> \u30d5\u30a1\u30a4\u30eb\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre data-label=\".eslintrc\" id=\".eslintrc\" class=\"wp-block-code lang-json\"><code>{\n\t\"extends\": &#91; \"plugin:@wordpress\/eslint-plugin\/recommended\" ],\n\t\"rules\": {\n\t\t\"@wordpress\/no-unsafe-wp-apis\": \"off\"\n\t}\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3082\u3046\u4e00\u5ea6 <code>lint:js<\/code> \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<code>__experimental<\/code> \u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u304c\u4ed8\u3044\u305f API \u306b\u95a2\u3059\u308b\u30a8\u30e9\u30fc\u304c\u6d88\u3048\u308b\u4e8b\u3092\u78ba\u8a8d\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3061\u306a\u307f\u306b\u3053\u306e\u30eb\u30fc\u30eb\u306f\u3001<a href=\"https:\/\/github.com\/WordPress\/gutenberg\/blob\/2a021834d58a0d2734194714d2777d15d16c065e\/.eslintrc.js#L188\" target=\"_blank\" rel=\"noreferrer noopener\">Gutenberg \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3082\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u65b0\u3057\u3044\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d6\u30ed\u30c3\u30af\u958b\u767a\u306b\u304a\u3051\u308b\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u3088\u308a\u9ad8\u3081\u5b89\u5168\u306a\u3082\u306e\u306b\u3059\u308b\u305f\u3081\u306b\u3001\u500b\u4eba\u7684\u306b\u63a8\u5968\u3057\u305f\u3044\u30eb\u30fc\u30eb\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u306f\u3001<code>@wordpress\/eslint-plugin<\/code> \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30eb\u30fc\u30eb\u306b\u306f\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u660e\u793a\u7684\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/jsx-eslint\/eslint-plugin-react\/blob\/d1556a3d2f95f56cfb6e7c0a341af16742f64033\/docs\/rules\/jsx-boolean-value.md\" target=\"_blank\" rel=\"noreferrer noopener\">react\/jsx-boolean-value<\/a><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">React \u306b\u304a\u3044\u3066\u3001prop \u306e\u5024\u304c <code>boolean<\/code> \u5024 \u304b\u3064 <code>true<\/code> \u3067\u3042\u308b\u5834\u5408\u306e\u30eb\u30fc\u30eb\u3092\u5f37\u5236\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre data-label=\".eslintrc\" id=\".eslintrc\" class=\"wp-block-code lang-json\"><code>{\n\t\"extends\": &#91; \"plugin:@wordpress\/eslint-plugin\/recommended\" ],\n\t\"rules\": {\n\t\t\"react\/jsx-boolean-value\": \"error\"\n\t}\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 \u3053\u3046\u3059\u3079\u304d<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>const Hello = &lt;Hello myProp \/&gt;;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u274c \u3053\u3046\u3059\u3079\u304d\u3067\u306f\u306a\u3044<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>const Hello = &lt;Hello myProp={ true } \/&gt;;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/WordPress\/gutenberg\/blob\/0466f7d510ef5185d054b3d30b19f21ed9ad986b\/packages\/eslint-plugin\/docs\/rules\/i18n-text-domain.md\" target=\"_blank\" rel=\"noreferrer noopener\">@wordpress\/i18n-text-domain<\/a><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ffb\u8a33\u95a2\u6570\u306b\u6b63\u3057\u3044\u30c6\u30ad\u30b9\u30c8\u30c9\u30e1\u30a4\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u3092\u5f37\u5236\u3057\u307e\u3059\u3002<code>allowedTextDomain<\/code> \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u306f\u3001\u81ea\u8eab\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre data-label=\".eslintrc\" id=\".eslintrc\" class=\"wp-block-code lang-json\"><code>{\n\t\"extends\": &#91; \"plugin:@wordpress\/eslint-plugin\/recommended\" ],\n\t\"rules\": {\n\t\t\"@wordpress\/i18n-text-domain\": &#91;\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t\"allowedTextDomain\": \"gutenpride\"\n\t\t\t}\n\t\t]\n\t}\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 \u3053\u3046\u3059\u3079\u304d<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>export default function Edit() {\n\tconst myVariable = __(\n\t\t'Gutenpride \u2013 hello from the editor!',\n\t\t'gutenpride'\n\t);\n\treturn &lt;p { ...useBlockProps() }&gt;{ myVariable }&lt;\/p&gt;;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u274c \u3053\u3046\u3059\u3079\u304d\u3067\u306f\u306a\u3044<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>export default function Edit() {\n\tconst myVariable = __(\n\t\t'Gutenpride \u2013 hello from the editor!'\n\t);\n\treturn &lt;p { ...useBlockProps() }&gt;{ myVariable }&lt;\/p&gt;;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/WordPress\/gutenberg\/blob\/0466f7d510ef5185d054b3d30b19f21ed9ad986b\/packages\/eslint-plugin\/docs\/rules\/dependency-group.md\" target=\"_blank\" rel=\"noreferrer noopener\">@wordpress\/dependency-group<\/a><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5225\u306e\u30bd\u30fc\u30b9\u304b\u3089\u30b3\u30fc\u30c9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3068\u304d\u306b\u3001\u305d\u308c\u3089\u3092\u9069\u5207\u306b\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u3066\u30b3\u30e1\u30f3\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u3092\u5f37\u5236\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre data-label=\".eslintrc\" id=\".eslintrc\" class=\"wp-block-code lang-json\"><code>{\n\t\"extends\": &#91; \"plugin:@wordpress\/eslint-plugin\/recommended\" ],\n\t\"rules\": {\n\t\t\"@wordpress\/dependency-group\": \"error\"\n\t}\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 \u3053\u3046\u3059\u3079\u304d<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>\/*\n * External dependencies\n *\/\nimport { camelCase } from 'change-case';\n\n\/*\n * WordPress dependencies\n *\/\nimport { Component } from 'react';\n\n\/*\n * Internal dependencies\n *\/\nimport edit from '.\/edit';<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u274c \u3053\u3046\u3059\u3079\u304d\u3067\u306f\u306a\u3044<\/p>\n\n\n\n<pre class=\"wp-block-code lang-js\"><code>import { camelCase } from 'change-case';\nimport { Component } from 'react';\nimport edit from '.\/edit';<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u3053\u3053\u307e\u3067\u306e\u30eb\u30fc\u30eb\u304c\u9069\u7528\u3055\u308c\u305f .eslintrc<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5909\u66f4\u3055\u308c\u305f\u30eb\u30fc\u30eb\u304a\u3088\u3073\u65b0\u3057\u3044\u30eb\u30fc\u30eb\u3092\u5168\u3066 .eslintrc \u306b\u9069\u7528\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u3092\u53c2\u8003\u306b\u3001\u81ea\u8eab\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3084\u597d\u307f\u306b\u5408\u3046\u3088\u3046\u306b\u6700\u9069\u306a\u30eb\u30fc\u30eb\u3092\u63a2\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre data-label=\".eslintrc\" id=\".eslintrc\" class=\"wp-block-code lang-json\"><code>{\n\t\"extends\": &#91; \"plugin:@wordpress\/eslint-plugin\/recommended\" ],\n\t\"rules\": {\n\t\t\"@wordpress\/no-unsafe-wp-apis\": \"off\",\n\t\t\"react\/jsx-boolean-value\": \"error\",\n\t\t\"@wordpress\/i18n-text-domain\": &#91;\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t\"allowedTextDomain\": \"gutenpride\"\n\t\t\t}\n\t\t],\n\t\t\"@wordpress\/dependency-group\": \"error\"\n\t}\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u3067 Lint \u30eb\u30fc\u30eb\u9055\u53cd\u3092\u691c\u51fa\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067\u3001Lint \u30a8\u30e9\u30fc\u306e\u4fee\u6b63\u3001\u30eb\u30fc\u30eb\u306e\u5909\u66f4\u30fb\u8ffd\u52a0\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u30a8\u30e9\u30fc\u3092\u691c\u51fa\u30fb\u4fee\u6b63\u3059\u308b\u305f\u3081\u306b\u3001\u30b3\u30fc\u30c9\u3092\u66f4\u65b0\u3059\u308b\u305f\u3073\u306b <code>lint:js<\/code> \u307e\u305f\u306f <code>format<\/code> \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u304f\u306e\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u3067\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5b58\u5728\u3059\u308b ESLint \u30eb\u30fc\u30eb\u3092\u81ea\u52d5\u7684\u306b\u8aad\u307f\u53d6\u308a\u3001\u305d\u308c\u3092\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u5185\u3067\u30a8\u30e9\u30fc\u3068\u3057\u3066\u691c\u51fa\u3057\u305f\u308a\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3059\u308b\u3068\u304d\u306b\u30eb\u30fc\u30eb\u306b\u9055\u53cd\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u7684\u306b\u4fee\u6b63\u3057\u305f\u308a\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u306f\u3001\u79c1\u304c\u666e\u6bb5\u4f7f\u7528\u3057\u3066\u3044\u308bVSCode \u3067\u306e\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u306f\u3001<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=dbaeumer.vscode-eslint\" target=\"_blank\" rel=\"noreferrer noopener\">ESLint \u62e1\u5f35<\/a>\u3092 VSCode \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u307e\u305f\u306f\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u8a2d\u5b9a\u3067\u3001ESLint \u304c\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"350\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-extension-840x350.png\" alt=\"\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u3067\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u308b ESLint \u62e1\u5f35\" class=\"wp-image-1273\" srcset=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-extension-840x350.png 840w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-extension-768x320.png 768w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/eslint-extension.png 902w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">ESLint \u62e1\u5f35\u304c\u6709\u52b9\u3067\u3042\u308a\u3001\u30eb\u30fc\u30eb\u306b\u9055\u53cd\u3059\u308b\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8b66\u544a\u304c\u8868\u793a\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"266\" src=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/vscode-eslint-error-840x266.png\" alt=\"ESLint \u62e1\u5f35\u304c\u767a\u3059\u308b\u8b66\u544a\" class=\"wp-image-1277\" srcset=\"https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/vscode-eslint-error-840x266.png 840w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/vscode-eslint-error-768x243.png 768w, https:\/\/aki-hamano.blog\/wp-content\/uploads\/2024\/10\/vscode-eslint-error.png 1476w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/\" target=\"_blank\" rel=\"noreferrer noopener\">@wordpress\/scripts \u2013 Block Editor Handbook | Developer.WordPress.org<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-eslint-plugin\/\" target=\"_blank\" rel=\"noreferrer noopener\">@wordpress\/eslint-plugin \u2013 Block Editor Handbook | Developer.WordPress.org<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/editorconfig.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">EditorConfig<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001WordPress \u30d6\u30ed\u30c3\u30af\u958b\u767a\u306b\u304a\u3051\u308b JavaScript \u306e\u30b3\u30fc\u30c9\u54c1\u8cea\u6539\u5584\u3001\u304a\u3088\u3073\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb\u7d71\u4e00\u306e\u305f\u3081\u306b\u3001ESLint \u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 ESLint \u3092\u5c0e\u5165\u3059\u308b\u7406\u7531  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"https:\/\/aki-hamano.blog\/?p=1187","footnotes":""},"categories":[21],"tags":[],"class_list":["post-1187","post","type-post","status-publish","format-standard","hentry","category-block-development","ja"],"_links":{"self":[{"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/posts\/1187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/comments?post=1187"}],"version-history":[{"count":114,"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/posts\/1187\/revisions"}],"predecessor-version":[{"id":1354,"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/posts\/1187\/revisions\/1354"}],"wp:attachment":[{"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/media?parent=1187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/categories?post=1187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aki-hamano.blog\/wp-json\/wp\/v2\/tags?post=1187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}