{"id":2893,"date":"2024-11-10T09:24:58","date_gmt":"2024-11-10T01:24:58","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2893\/"},"modified":"2024-11-10T09:24:58","modified_gmt":"2024-11-10T01:24:58","slug":"%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3-sublime-text-3-%e7%9a%84-eslint-%e6%8f%92%e4%bb%b6%e9%85%8d%e7%bd%ae%e9%97%ae%e9%a2%98%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2893\/","title":{"rendered":"\u5982\u4f55\u89e3\u51b3 Sublime Text 3 \u7684 ESLint \u63d2\u4ef6\u914d\u7f6e\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173090376446531.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u89e3\u51b3 Sublime Text 3 \u7684 ESLint \u63d2\u4ef6\u914d\u7f6e\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u89e3\u51b3 Sublime Text 3 \u7684 ESLint \u63d2\u4ef6\u914d\u7f6e\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> text 3 \u7684 eslint \u63d2\u4ef6\u914d\u7f6e<\/strong><\/p>\n<p>sublime text 3 \u7684 eslint \u63d2\u4ef6\u5728\u4f7f\u7528\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e24\u79cd\u89e3\u51b3\u8fd9\u4e9b\u9519\u8bef\u7684\u914d\u7f6e\u65b9\u6cd5\u3002<\/p>\n<p><strong>\u65b9\u5f0f\u4e00\uff1a\u4fee\u6539 .eslintrc.json \u914d\u7f6e<\/strong><\/p>\n<p>\u627e\u5230 .eslintrc.json \u6587\u4ef6\u5e76\u5bf9\u5176\u8fdb\u884c\u7f16\u8f91\u3002\u5bf9\u4e8e\u4f60\u9047\u5230\u7684\u7f29\u8fdb\u9519\u8bef\uff0c\u53ef\u4ee5\u5c06 &#8220;indent&#8221; \u89c4\u5219\u4fee\u6539\u4e3a\u4f7f\u7528 4 \u4e2a\u7a7a\u683c\uff1a<\/p>\n<pre>{\n  \"indent\": [\"error\", 4, { \"switchcase\": 1 }]\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u65b9\u5f0f\u4e8c\uff1a\u6dfb\u52a0 .eslintignore \u5ffd\u7565\u9879<\/strong><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a .eslintignore \u7684\u7a7a\u6587\u4ef6\u5e76\u5c06\u5176\u653e\u5728\u9879\u76ee\u6839\u76ee\u5f55\u3002\u5728\u6b64\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4efb\u4f55\u4f60\u60f3\u8ba9 eslint \u5ffd\u7565\u7684\u9879\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u60f3\u5ffd\u7565\u7f29\u8fdb\u89c4\u5219\uff0c\u53ef\u4ee5\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>**\/.eslintrc.js**<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u89e3\u51b3 Sublime Text 3 \u7684 ESLint \u63d2\u4ef6\u914d\u7f6e\u95ee\u9898\uff1f\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>text 3 \u7684 eslint \u63d2\u4ef6\u914d\u7f6e sublime text 3 \u7684 eslint \u63d2\u4ef6\u5728\u4f7f\u7528\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e24\u79cd\u89e3\u51b3\u8fd9\u4e9b\u9519\u8bef\u7684\u914d\u7f6e\u65b9\u6cd5\u3002 \u65b9\u5f0f\u4e00\uff1a\u4fee\u6539 .eslintrc.json \u914d\u7f6e \u627e\u5230 .eslintrc.json \u6587\u4ef6\u5e76\u5bf9\u5176\u8fdb\u884c\u7f16\u8f91\u3002\u5bf9\u4e8e\u4f60\u9047\u5230\u7684\u7f29\u8fdb\u9519\u8bef\uff0c\u53ef\u4ee5\u5c06 &#8220;indent&#8221; \u89c4\u5219\u4fee\u6539\u4e3a\u4f7f\u7528 4 \u4e2a\u7a7a\u683c\uff1a { &#8220;indent&#8221;: [&#8220;error&#8221;, 4, { &#8220;switchcase&#8221;: 1 }] } \u767b\u5f55\u540e\u590d\u5236 \u65b9\u5f0f\u4e8c\uff1a\u6dfb\u52a0 .eslintignore \u5ffd\u7565\u9879 \u521b\u5efa\u4e00\u4e2a\u540d\u4e3a .eslintignore \u7684\u7a7a\u6587\u4ef6\u5e76\u5c06\u5176\u653e\u5728\u9879\u76ee\u6839\u76ee\u5f55\u3002\u5728\u6b64\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4efb\u4f55\u4f60\u60f3\u8ba9 eslint \u5ffd\u7565\u7684\u9879\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u60f3\u5ffd\u7565\u7f29\u8fdb\u89c4\u5219\uff0c\u53ef\u4ee5\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a **\/.eslintrc.js** \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u89e3\u51b3 Sublime Text 3 \u7684 ESLint \u63d2\u4ef6\u914d\u7f6e\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-2893","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2893","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=2893"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2893\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}