Skip to content

Commit

Permalink
Update VS Code configuration (#38710)
Browse files Browse the repository at this point in the history
* Enable auto-formatting of PHP files

* Add recommended VS Code extensions

* Add comments
  • Loading branch information
manzoorwanijk authored Aug 20, 2024
1 parent e5f1d13 commit 8c1bd34
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
/**
* List of recommended extensions to use for this workspace.
* The identifier of an extension is always `${publisher}.${name}`,
* which is a part of the URL, e.g. https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
* You can view these extensions using the command `Extensions: Show Recommended Extensions`.
*/
"recommendations": [
"bmewburn.vscode-intelephense-client", // PHP Intelephense
"dbaeumer.vscode-eslint", // ESLint
"esbenp.prettier-vscode", // Prettier - Code formatter
"obliviousharmony.vscode-php-codesniffer" // PHP_CodeSniffer
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.dist.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
"**/jetpack_vendor/**",
"**/vendor/**"
],
// Custom settings for PHP files.
"[php]": {
// Ensure that PHP files are formatted with PHPCS.
"editor.formatOnSave": true,
"editor.defaultFormatter": "obliviousharmony.vscode-php-codesniffer"
},
// Run Code Actions for the editor.
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
// Use this wp-prettier from this path.
"prettier.prettierPath": "tools/js-tools/node_modules/prettier/index.cjs"
}

0 comments on commit 8c1bd34

Please sign in to comment.