diff --git a/.gitignore b/.gitignore index c17c3f5d2c48..6b39f1a0a43f 100644 --- a/.gitignore +++ b/.gitignore @@ -80,6 +80,8 @@ packages/babel-standalone/babel.min.js /eslint/*/LICENSE !/packages/babel-eslint-plugin/LICENSE +.vscode +!.vscode/settings.example.json # local directory for VSCode Extension - https://marketplace.visualstudio.com/items?itemName=xyz.local-history /.history diff --git a/.vscode/settings.json b/.vscode/settings.example.json similarity index 92% rename from .vscode/settings.json rename to .vscode/settings.example.json index b74ddc0ae136..63d1e8f54015 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.example.json @@ -1,5 +1,4 @@ { - "editor.formatOnSave": true, "json.schemas": [ { "fileMatch": [ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 23ab7c7adad5..2e355772a9dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -334,6 +334,14 @@ For both `@babel/plugin-x` and `@babel/parser`, you can easily generate an `outp - output.json (will be generated if not created) ``` +#### Editor setup + +We have JSON Schema definitions so that your editor can provide autocomplete for `options.json` files in fixtures: +- `./packages/babel-helper-fixtures/data/schema.json` for plugins/presets tests +- `./packages/babel-parser/test/schema.json` for parser tests + +If you use VS Code you can copy the contents of `.vscode/settings.example.json` into `.vscode/settings.json` to make it use the JSON Schema definitions. Other editors have different options to load JSON Schema files. + ### Debugging code A common approach to debugging JavaScript code is to walk through the code using the [Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/) debugger.