{"id":21528,"date":"2024-11-19T14:37:54","date_gmt":"2024-11-19T06:37:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21528\/"},"modified":"2024-11-19T14:37:54","modified_gmt":"2024-11-19T06:37:54","slug":"git%e6%80%8e%e4%b9%88%e5%bf%bd%e7%95%a5eslint%e5%bc%ba%e5%88%b6%e6%8f%90%e4%ba%a4","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21528\/","title":{"rendered":"git\u600e\u4e48\u5ffd\u7565eslint\u5f3a\u5236\u63d0\u4ea4"},"content":{"rendered":"<blockquote><p>\n  \u95ee\u9898\uff1a\u5982\u4f55\u5ffd\u7565 eslint \u5f3a\u5236\u63d0\u4ea4\uff1f\u7b54\u6848\uff1a\u4f7f\u7528 .eslintignore \u6587\u4ef6\u3002\u8be6\u7ec6\u8bf4\u660e\uff1a1. \u521b\u5efa .eslintignore \u6587\u4ef6\uff1b2. \u586b\u5199 glob \u6a21\u5f0f\uff1b3. \u5c06 .eslintignore \u6587\u4ef6\u6dfb\u52a0\u5230 git \u4ed3\u5e93\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/30\/2024053023185418279.jpg\" class=\"aligncenter\" title=\"git\u600e\u4e48\u5ffd\u7565eslint\u5f3a\u5236\u63d0\u4ea4\u63d2\u56fe\" alt=\"git\u600e\u4e48\u5ffd\u7565eslint\u5f3a\u5236\u63d0\u4ea4\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Git \u4e2d\u5ffd\u7565 ESLint \u5f3a\u5236\u63d0\u4ea4<\/strong><\/p>\n<p><strong>\u7b54\u6848\uff1a<\/strong><\/p>\n<p>\u4f7f\u7528 .eslintignore \u6587\u4ef6\u3002<\/p>\n<p><strong>\u8be6\u7ec6\u8bf4\u660e\uff1a<\/strong><\/p>\n<p>ESLint \u662f\u4e00\u4e2a JavaScript \u4ee3\u7801\u9759\u6001\u5206\u6790\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u68c0\u67e5\u4ee3\u7801\u4e2d\u7684\u9519\u8bef\u548c\u98ce\u683c\u4e0d\u4e00\u81f4\u3002\u5728 Git \u4ed3\u5e93\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5f3a\u5236\u63d0\u4ea4\u5305\u542b\u7b26\u5408 ESLint \u89c4\u5219\u7684\u6587\u4ef6\u624d\u80fd\u63d0\u4ea4\u66f4\u6539\u3002\u5982\u679c\u60a8\u5e0c\u671b\u5ffd\u7565\u67d0\u4e9b\u6587\u4ef6\u6216\u4ee3\u7801\u5757\u7684 ESLint \u68c0\u67e5\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa .eslintignore \u6587\u4ef6\u3002<\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a .eslintignore \u7684\u6587\u4ef6\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u60a8\u8981\u5ffd\u7565\u7684\u6587\u4ef6\u6216\u4ee3\u7801\u5757\u7684 glob \u6a21\u5f0f\u3002<\/li>\n<li>\u5c06 .eslintignore \u6587\u4ef6\u6dfb\u52a0\u5230 Git \u4ed3\u5e93\u3002<\/li>\n<\/ol>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u5047\u8bbe\u60a8\u5e0c\u671b\u5ffd\u7565\u6240\u6709 src\/test \u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\uff1a<\/p>\n<pre>.eslintignore\nsrc\/test\/**<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fdd\u5b58 .eslintignore \u6587\u4ef6\u540e\uff0cGit \u5c06\u5728\u5f3a\u5236\u63d0\u4ea4\u65f6\u5ffd\u7565\u60a8\u6307\u5b9a\u7684\u6a21\u5f0f\u3002\u60a8\u4ecd\u7136\u53ef\u4ee5\u624b\u52a8\u8fd0\u884c ESLint \u6765\u68c0\u67e5\u8fd9\u4e9b\u6587\u4ef6\uff0c\u4f46\u5b83\u4eec\u5c06\u4e0d\u518d\u963b\u6b62\u60a8\u63d0\u4ea4\u66f4\u6539\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5ffd\u7565eslint\u5f3a\u5236\u63d0\u4ea4\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\uff1a\u5982\u4f55\u5ffd\u7565 eslint \u5f3a\u5236\u63d0\u4ea4\uff1f\u7b54\u6848\uff1a\u4f7f\u7528 .eslintignore \u6587\u4ef6\u3002\u8be6\u7ec6\u8bf4\u660e\uff1a1. \u521b\u5efa .eslintignore \u6587\u4ef6\uff1b2. \u586b\u5199 glob \u6a21\u5f0f\uff1b3. \u5c06 .eslintignore \u6587\u4ef6\u6dfb\u52a0\u5230 git \u4ed3\u5e93\u3002 \u5982\u4f55\u5728 Git \u4e2d\u5ffd\u7565 ESLint \u5f3a\u5236\u63d0\u4ea4 \u7b54\u6848\uff1a \u4f7f\u7528 .eslintignore \u6587\u4ef6\u3002 \u8be6\u7ec6\u8bf4\u660e\uff1a ESLint \u662f\u4e00\u4e2a JavaScript \u4ee3\u7801\u9759\u6001\u5206\u6790\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u68c0\u67e5\u4ee3\u7801\u4e2d\u7684\u9519\u8bef\u548c\u98ce\u683c\u4e0d\u4e00\u81f4\u3002\u5728 Git \u4ed3\u5e93\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5f3a\u5236\u63d0\u4ea4\u5305\u542b\u7b26\u5408 ESLint \u89c4\u5219\u7684\u6587\u4ef6\u624d\u80fd\u63d0\u4ea4\u66f4\u6539\u3002\u5982\u679c\u60a8\u5e0c\u671b\u5ffd\u7565\u67d0\u4e9b\u6587\u4ef6\u6216\u4ee3\u7801\u5757\u7684 ESLint \u68c0\u67e5\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa .eslintignore \u6587\u4ef6\u3002 \u6b65\u9aa4\uff1a \u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a .eslintignore \u7684\u6587\u4ef6\u3002 \u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u60a8\u8981\u5ffd\u7565\u7684\u6587\u4ef6\u6216\u4ee3\u7801\u5757\u7684 glob \u6a21\u5f0f\u3002 \u5c06 .eslintignore \u6587\u4ef6\u6dfb\u52a0\u5230 Git \u4ed3\u5e93\u3002 \u793a\u4f8b\uff1a \u5047\u8bbe\u60a8\u5e0c\u671b\u5ffd\u7565\u6240\u6709 src\/test \u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\uff1a .eslintignore [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-21528","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=21528"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21528\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}