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

Running the dev server is overwriting my vscode settings file, and updating my .gitignore #41808

Closed
1 task done
sandervspl opened this issue Oct 25, 2022 · 3 comments · Fixed by #42169
Closed
1 task done
Labels
Developer Experience Issues related to Next.js logs, Error overlay, etc.

Comments

@sandervspl
Copy link

sandervspl commented Oct 25, 2022

Verify canary release

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

Provide environment information

Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000
Binaries:
Node: 16.14.0
npm: 8.3.1
Yarn: 1.22.19
pnpm: 7.13.4
Relevant packages:
next: 12.3.2-canary.43
eslint-config-next: 13.0.0
react: 18.2.0
react-dom: 18.2.0

What browser are you using? (if relevant)

Chrome

How are you deploying your application? (if relevant)

N/A

Describe the Bug

I have a settings.json file in my project's .vscode folder. It has some settings in there that I need for my project. However, running next dev wipes this file and replaces it with some kind of TypeScript settings.

Before

{
  "css.customData": [".vscode/css.json"],
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

After

{
-  "css.customData": [".vscode/css.json"],
-  "editor.formatOnSave": true,
-  "editor.defaultFormatter": "esbenp.prettier-vscode",
+  "typescript.tsdk": "./node_modules/typescript/lib",
+  "typescript.enablePromptUseWorkspaceTsdk": true
}

Also, I want to push this folder to git. Currently my .gitignore keeps being updated with a new .vscode line added to it, which I don't want.

This bug appears to exist in both the latest canary release and 13.0.0

Expected Behavior

Don't remove my settings. Add the lines to the existing JSON file instead of overwriting the file. Also, don't force me to ignore the .vscode folder if I DO want to add it to git.

Link to reproduction

N/A

To Reproduce

  1. Create a .vscode folder
  2. Add a settings.json file to that folder
  3. Add any JSON
  4. Run next dev
@sandervspl sandervspl added the bug Issue was opened via the bug report template. label Oct 25, 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 Oct 27, 2022
@laozhu
Copy link

laozhu commented Oct 29, 2022

The same issue here, DON'T override my .vscode/settings.json and .gitignore.

ijjk added a commit that referenced this issue Oct 30, 2022
This ensures we correctly preserve comments in the config similar to our
tsconfig handling and removes the `gitignore` updating as we can't infer
safely if a user wants this file ignored or not.

Fixes: #41808

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
@HaoboZ
Copy link

HaoboZ commented Oct 30, 2022

The .gitignore is not updating anymore, but it seems this didn't fix adding the .vscode folder. Especially for those who don't use vscode, it just adds an unnecessary folder

@github-actions
Copy link
Contributor

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 Nov 30, 2022
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.

4 participants