{"id":1073,"date":"2023-03-12T10:46:54","date_gmt":"2023-03-12T02:46:54","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1073"},"modified":"2023-04-29T11:44:40","modified_gmt":"2023-04-29T03:44:40","slug":"eslint-xxx-is-assigned-a-value-but-never-used","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/12\/eslint-xxx-is-assigned-a-value-but-never-used\/","title":{"rendered":"ESLint xxx is assigned a value but never used \u7684\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"<p>ESLint\u4e2d\u6587\u7ffb\u8bd1\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/eslint.cn\/\">http:\/\/eslint.cn\/<\/a><\/p>\n<p>\u95ee\u9898\u63cf\u8ff0\uff1a\u5b9a\u4e49\u53d8\u91cf\u5e76\u4f7f\u7528\u4e86\uff0c\u4f46\u662fESLint\u8fd8\u662f\u62a5\u53d8\u91cf\u5b9a\u4e49\u8fc7\u4f46\u672a\u4f7f\u7528\u7684\u9519\u8bef<\/p>\n<p><!-- more --><\/p>\n<h3>\u7b80\u5355\u89e3\u51b3\u529e\u6cd5<\/h3>\n<p>\u5728\u6bcf\u4e00\u884c\u62a5\u9519\u7684\u5730\u65b9\u90fd\u52a0\u4e00\u884c\u6ce8\u91ca<\/p>\n<p>\u5728\u58f0\u660e\u53d8\u91cf\u7684\u5f53\u524d\u884c\u52a0\u4e0a\u4e00\u6761\u6ce8\u91ca \/\/ eslint-disable-line no-unused-vars<\/p>\n<h3>\u66b4\u529b\u89e3\u51b3\u529e\u6cd5<\/h3>\n<p>\u76f4\u63a5\u7981\u7528\u53d8\u91cf\u58f0\u660e\u4f46\u672a\u4f7f\u7528\u7684\u63d0\u793a\uff0c\u6bd4\u8f83\u7701\u5fc3\uff0c\u4e0d\u7528\u52a0\u4e00\u5806\u6ce8\u91ca\uff0c\u4f46\u4ee3\u7801\u68c0\u67e5\u529f\u80fd\u964d\u4f4e<\/p>\n<p>\u8bbe\u7f6e.eslint.json(\u6216\u8005\u662fyaml\u7b49)\u7684 <code>no-unused-vars<\/code> \u89c4\u5219\u4e3a\u7981\u7528(0\u4e3a\u7981\u7528)\u3002\u5177\u4f53\u53ef\u4ee5\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/eslint.cn\/docs\/rules\/no-unused-vars\">http:\/\/eslint.cn\/docs\/rules\/no-unused-vars<\/a><\/p>\n<pre><code class=\"language-javascript\">{\n  &quot;rules&quot;:{\n    &quot;no-unused-vars&quot;:0\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>ESLint\u4e2d\u6587\u7ffb\u8bd1\uff1ahttp:\/\/eslint.cn\/ \u95ee\u9898\u63cf\u8ff0\uff1a\u5b9a\u4e49\u53d8\u91cf\u5e76\u4f7f\u7528\u4e86\uff0c\u4f46\u662fESLint\u8fd8\u662f\u62a5\u53d8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[295],"class_list":["post-1073","post","type-post","status-publish","format-standard","hentry","category-node","tag-eslint"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1073"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1073\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}