Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created a vscode workspace file for the repo #29830

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ module.exports = {
parser: 'flow',
arrowParens: 'avoid',
overrides: [
{
files: ['*.code-workspace'],
options: {
parser: 'json-stringify',
},
},
{
files: esNextPaths,
options: {
Expand Down
30 changes: 30 additions & 0 deletions react.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"folders": [
{
"path": "."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to opt out /compiler? We use TypeScript there not Flow so these would be the wrong set of settings to apply

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check this out!

Copy link
Member

@huntie huntie Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix this (approximating) by scoping the javascript.validate.enable setting by file type. (Do test this!)

    // Does not match `.ts`, `.tsx`, approximating all flow files
    "[javascript]": {
      "javascript.validate.enable": false
    },

All other settings are innocuous under compiler/.

Edit: I just realised javascript.validate.enable and typescript.validate.enable are separate — this should all be fine.

Copy link
Contributor Author

@vzaidman vzaidman Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed with:

    "prettier.configPath": "",
    "prettier.ignorePath": ""

that would ensure that the local setting of prettier is used to validate the files inside "compiler" as opposed to the default settings that always relies on the config file in the root.

this way prettier is used for formatting and picks up typescript in the compiler folder

now it works:
Screen Recording 2024-06-13 at 12 21 24

}
],
"extensions": {
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"flowtype.flow-for-vscode"
]
},
"settings": {
"search.exclude": {
"**/dist/**": true,
"**/build/**": true,
"**/out/**": true,
"*.map": true,
"*.log": true
},
"javascript.validate.enable": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"flow.pathToFlow": "${workspaceFolder}/node_modules/.bin/flow",
"prettier.configPath": "",
"prettier.ignorePath": ""
}
}