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

.vscode folder being added #42213

Closed
1 task done
HaoboZ opened this issue Oct 31, 2022 · 15 comments · Fixed by #49133
Closed
1 task done

.vscode folder being added #42213

HaoboZ opened this issue Oct 31, 2022 · 15 comments · Fixed by #49133
Labels
Developer Experience Issues related to Next.js logs, Error overlay, etc.

Comments

@HaoboZ
Copy link

HaoboZ commented Oct 31, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Home
Binaries:
  Node: 19.0.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 13.0.1-canary.2
  eslint-config-next: 13.0.1-canary.2
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

.vscode folder and files being added whenever running the server. I'm not using vscode, so this shouldn't apply, is there a reason this needs to be added?

Expected Behavior

Don't generate a .vscode folder

Link to reproduction

https://codesandbox.io/s/next-vscode-settings-generation-bug-c9ouvj?file=/package.json

To Reproduce

https://github.com/vercel/next.js/pull/42169 removed related issue, the .gitignore was fixed but vscode was not.

@HaoboZ HaoboZ added the bug Issue was opened via the bug report template. label Oct 31, 2022
@balazsorban44 balazsorban44 added kind: bug Developer Experience Issues related to Next.js logs, Error overlay, etc. and removed bug Issue was opened via the bug report template. labels Nov 4, 2022
@cereallarceny
Copy link

Bumping this. Super annoying to see my VS Code settings overwritten. Also, when working in a monorepo, this also makes no sense. I've found a few other issues that have been closed to inactivity, but this is absolutely still an issue @balazsorban44 .

Problems:

  1. It's not remotely necessary.
  2. It promotes favoritism in code editors (although I happen to use VSCode, I can imaging this clutters the working environments of other developers unlike myself).
  3. It doesn't work in monorepos - hello Turborepo!
  4. It overwrites the existing VSCode settings that a developer may have deliberately put.

Relevant issues:

Solution(s):
I feel like this should be something configurable, with the ability to opt-in or opt-out of this functionality. This could also easily be done as a codemod. I'm happy to attempt a PR on any of the aforementioned solutions if I can get buy-in from the Next team to change the default behavior.

@hlege
Copy link

hlege commented Dec 14, 2022

in monorepo the .vscode folder is also create in the subproject instead of the root folder.

@HummingMind
Copy link

HummingMind commented Dec 19, 2022

+1. Using WebStrom. This folder keeps showing up after every build.
No need for the .vscode folder.

@kriswuollett
Copy link
Contributor

Just revert #41710 and similar patches until this is figured out? Assuming developers have a single project at the root of their repo can no longer be done -- especially after the Vercel acquisition of Turborepo.

Maybe just a README.md file for each IDE on how to set it up? That would be helpful especially if things like server-side sync of settings is used.

If it really is desired to help with these types configuration changes for us, it would be great if it was done in a next doctor subcommand instead that points all the things that should to be changed, with a --fix option to apply it for us if desired. Recommend looking at Flutter Doctor for inspiration.

@theboxer
Copy link

theboxer commented Feb 6, 2023

+1 for not automatically creating .vscode folder or at least have an option to disable it. Not using VS Code, so there's not reason why it should get created.

@cabaret
Copy link

cabaret commented Mar 30, 2023

Bumping this again. I'm not using VS Code and I don't want the .vscode folder in my projects. There's no reason to emit the VS Code config every time the server starts. At least provide the option to disable this, or provide a separate command to generate it.

@p-chan
Copy link

p-chan commented Apr 19, 2023

This is a vexing problem for monorepo users...:cry:
A .vscode/settings.json in a non-root directory is not useful.
They should be able to opt-out of automatic generation.

@yordis
Copy link
Contributor

yordis commented Apr 21, 2023

We are not VS Code users, and we have a mono-repo that is not at the root, and it lives next to other projects that aren't even NodeJS

@vighnesh153
Copy link

I don't use VS code and I hate that .vscode is being created automatically. And no, I am not going to add it to gitignore (why should I?). It should be a opt-in feature for VS code users, instead.

On a side note, why was the decision of creating/updating .vscode/settings.json made without even checking if the user is using VS Code? Is Vercel promoting the use of VS code? Is Vercel indirectly demoting other major IDE creators like Jetbrains?

@theboxer
Copy link

theboxer commented May 1, 2023

@vighnesh153 Couldn't agree more. This unreasonable push of vscode is just 🤮

How hard it is to create the file on your own if you need it...

vighnesh153 added a commit to vighnesh153/vighnesh153-monorepo that referenced this issue May 1, 2023
@shuding
Copy link
Member

shuding commented May 3, 2023

Hey all, thanks for the feedback! The .vscode/settings.json is there to make VSCode use the TypeScript version in your node_modules folder (otherwise it will use the built-in one by default), so we can provide some TypeScript related IntelliSense features. This is required by TypeScript.

Let me see how we can improve this!

@will-stone
Copy link

@shuding People can manage this themselves by setting "typescript.enablePromptUseWorkspaceTsdk": true, which will prompt them to use the workspace version when opening the project.

@shuding
Copy link
Member

shuding commented May 3, 2023

@will-stone That's the default behavior of Jetbrains editors which is what I expect. I wish VS Code can have that as a default too but unfortunately that's not the case. I've got people asking "why autocompletion isn't working" because they don't know how to set that up, or it isn't very obvious.

@will-stone
Copy link

Could this be a documented thing then? As writing config files to people's projects doesn't sound like it's winning you fans ☝️

timneutkens added a commit that referenced this issue May 3, 2023
## What?

Removes writing the `.vscode/settings.json` config. This config is
needed in order to leverage the new Next.js TypeScript plugin.
What we'll do instead is add a message in the docs on how to enable it.
We'll also explore a VSCode extension that warns when you don't have the
TypeScript plugin set up.

## How?

Removed the code related to writing `.vscode`.


Closes #42213

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Developer Experience Issues related to Next.js logs, Error overlay, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

14 participants