diff --git a/.gitignore b/.gitignore index c100239b87f2..7f6c76220493 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ +# VSCode - see .vscode/README.md +.vscode/ + +# Build files /out/ /out-wpt/ - -*.code-workspace - .tscache/ *.tmp.txt @@ -184,7 +185,4 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# VSCode -.vscode/ - # End of https://www.gitignore.io/api/linux,macos,windows,node diff --git a/.vscode/README.md b/.vscode/README.md new file mode 100644 index 000000000000..dc2d3c39cf55 --- /dev/null +++ b/.vscode/README.md @@ -0,0 +1,5 @@ +You can use `settings.json`/`tasks.json` in this directory for personal settings. + +To edit the default settings, modify `cts.code-workspace`, which is checked into the repository. + +Note: VS Code's setting precedence is `.vscode/` > `cts.code-workspace` > global user settings. diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 08171ad9c176..000000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.detectIndentation": false, - "editor.formatOnSave": true, - "editor.rulers": [100], - "editor.tabSize": 2, - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true, - "files.exclude": { - "*.tmp.txt": true, - ".gitignore": true, - ".travis.yml": true, - ".tscache": true, - "deploy_key.enc": true, - "node_modules": true, - "out": true, - "out-wpt": true, - "package-lock.json": true - }, - "typescript.preferences.importModuleSpecifier": "relative", - "typescript.preferences.quoteStyle": "single" -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 85d45561f8bb..000000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "grunt", - "task": "test", - "problemMatcher": [], - "group": { - "kind": "build", - "isDefault": true - } - }, - { - "type": "grunt", - "task": "pre", - "problemMatcher": [] - }, - { - "type": "grunt", - "task": "check", - "problemMatcher": [ - "$tsc" - ] - } - ] -} diff --git a/cts.code-workspace b/cts.code-workspace new file mode 100644 index 000000000000..3b5b67b8dd78 --- /dev/null +++ b/cts.code-workspace @@ -0,0 +1,52 @@ +// Note: VS Code's setting precedence is `.vscode/` > `cts.code-workspace` > global user settings. +{ + "folders": [{ "path": "." }], + "settings": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.detectIndentation": false, + "editor.rulers": [100], + "editor.tabSize": 2, + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "files.trimTrailingWhitespace": true, + "files.exclude": { + "*.tmp.txt": true, + ".gitignore": true, + ".travis.yml": true, + ".tscache": true, + "deploy_key.enc": true, + "node_modules": true, + "out": true, + "out-wpt": true, + "package-lock.json": true + }, + // Configure VSCode to use the right style when automatically adding imports on autocomplete. + "typescript.preferences.importModuleSpecifier": "relative", + "typescript.preferences.importModuleSpecifierEnding": "js", + "typescript.preferences.quoteStyle": "single" + }, + "tasks": { + "version": "2.0.0", + "tasks": [ + { + "type": "grunt", + "task": "test", + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "type": "grunt", + "task": "pre", + "problemMatcher": [] + }, + { + "type": "grunt", + "task": "check", + "problemMatcher": ["$tsc"] + } + ] + } +}