{"id":2336,"date":"2022-10-29T03:31:48","date_gmt":"2022-10-29T01:31:48","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=2336"},"modified":"2022-10-29T03:31:48","modified_gmt":"2022-10-29T01:31:48","slug":"how-to-configure-vscode-settings-to-use-eslint-for-formatting","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2022\/10\/29\/how-to-configure-vscode-settings-to-use-eslint-for-formatting\/","title":{"rendered":"How to configure VSCode Settings to use ESLint for Formatting"},"content":{"rendered":"\n<p>Let\u00b4s say we are working on a project that uses ESLint to manage its code style, and we want to match the team\u2019s formatting.<\/p>\n\n\n\n<p>\u00a0so let\u00b4s configure our VSCode to use ESLint :<\/p>\n\n\n\n<ol><li>Install VSCode ESLint Plugin<\/li><li>Add these 4 new lines inside the top-level settings object:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>{\r\n  \/\/ ...\r\n  \"eslint.format.enable\": true,\r\n  \"editor.codeActionsOnSave\": {\r\n    \"source.fixAll.eslint\": true\r\n  }\r\n}<\/code><\/pre>\n\n\n\n<p>The first one turns on ESLint for formatting, and the next one make it do the formatting when you hit save.<\/p>\n\n\n\n<p>That should do it! Save the settings file and close it, we\u2019re done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let\u00b4s say we are working on a project that uses ESLint to manage its code style, and we want to match the team\u2019s formatting. \u00a0so let\u00b4s configure our VSCode to use ESLint : Install VSCode ESLint Plugin Add these 4 new lines inside the top-level settings object: The first one turns on ESLint for formatting, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1919,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[37],"tags":[252,251,575,621,161,217,299],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2336"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2336"}],"version-history":[{"count":1,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2336\/revisions"}],"predecessor-version":[{"id":2337,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2336\/revisions\/2337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/1919"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}