-
Notifications
You must be signed in to change notification settings - Fork 6
Setting up VSCode for Linting
Helen edited this page Jan 5, 2021
·
2 revisions
This page outlines how to set up VSCode for linting and auto-fixing.
Note: It is not necessary to use VSCode to develop in Design System. However, many members of the team use it, and it may make your life easier.
- Install the ESLint extension
- Install the Prettier extension
- Install the StyleLint extension
- If you would like these to automatically format on save, you can configure this by going to your Settings File and configuring via the documentation in the extensions page. Here's a jumping off point:
{
"javascript.validate.enable": false,
"files.autoSave": "afterDelay",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.tslint": false,
"source.fixAll.eslint": true
},
"editor.renderWhitespace": "all",
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.alwaysShowStatus": true
}
Still have questions? Want to improve this documentation? We're available on the #design-system slack channel.