Last active
February 14, 2025 13:35
-
-
Save wojtekmaj/8dc8f75b94da4a8107263abbfb027ccf to your computer and use it in GitHub Desktop.
VSCode settings worth checking out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Enables breadcrumbs | |
"breadcrumbs.enabled": true, | |
// Slightly improves performance if you don't usescreen reader | |
"editor.accessibilitySupport": "off", | |
// My favorite font settings | |
"editor.fontFamily": "'Fira Code', monospace", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 14, | |
"editor.fontWeight": 400, | |
"terminal.integrated.fontFamily": "'Fira Code', monospace", | |
"terminal.integrated.fontLigatures.enabled": true, | |
"terminal.integrated.fontSize": 14, | |
"terminal.integrated.fontWeight": 400, | |
// Auto save files on focus change | |
"files.autoSave": "onFocusChange", | |
// …or alternatively, save files immediately as you write, if your dev stack does not suck | |
"files.autoSave": "afterDelay", | |
"files.autoSaveDelay": 0, | |
// Format files using their default formatter on save | |
"editor.formatOnSave": true, | |
// Disables minimap | |
"editor.minimap.enabled": false, | |
// Renders whitespace as visible characters | |
"editor.renderWhitespace": "all", | |
// YOLO: Deleting and moving files without confirmation | |
"explorer.confirmDelete": false, | |
"explorer.confirmDragAndDrop": false, | |
// Groups related files, like index.ts and index.test.ts, together | |
"explorer.fileNesting.enabled": true, | |
"explorer.fileNesting.expand": true, | |
"explorer.fileNesting.patterns": { | |
"package.json": "", | |
".env": ".env.example, .env.local, .env.development, .env.test, .env.production", | |
"*.js": "$(capture).bench.*, $(capture).benchmark.*, $(capture).spec.*, $(capture).test.*, $(capture).styles.*, $(capture).css, $(capture).module.css, $(capture).less, $(capture).d.ts, $(capture).js.map", | |
"*.cjs": "$(capture).bench.*, $(capture).benchmark.*, $(capture).spec.*, $(capture).test.*, $(capture).styles.*, $(capture).css, $(capture).module.css, $(capture).less, $(capture).d.cts, $(capture).cjs.map", | |
"*.ts": "$(capture).bench.*, $(capture).benchmark.*, $(capture).spec.*, $(capture).test.*, $(capture).styles.*, $(capture).css, $(capture).module.css, $(capture).less", | |
"*.jsx": "$(capture).bench.*, $(capture).benchmark.*, $(capture).spec.*, $(capture).test.*, $(capture).styles.*, $(capture).css, $(capture).module.css, $(capture).less, $(capture).d.ts", | |
"*.tsx": "$(capture).bench.*, $(capture).benchmark.*, $(capture).spec.*, $(capture).test.*, $(capture).styles.*, $(capture).css, $(capture).module.css, $(capture).less" | |
}, | |
// Disable annoying popups with extension recommendations | |
"extensions.ignoreRecommendations": true, | |
// Makes VSCode correctly recognize .env.local, .env.prod files as properties files | |
"files.associations": { | |
".env.*": "properties" | |
}, | |
// Hides trash directories | |
"files.exclude": { | |
"**/.cache": true, | |
"**/.husky": true, | |
"**/.next": true, | |
"**/.nyc_output": true, | |
"**/.swc": true, | |
"**/.tmp": true, | |
}, | |
// Disables search in trash directories | |
"search.exclude": { | |
"**/.cache": true, | |
"**/.husky": true, | |
"**/.next": true, | |
"**/.nyc_output": true, | |
"**/.swc": true, | |
"**/.tmp": true, | |
"**/.yarn": true | |
}, | |
// Fetch repositories automatically | |
"git.autofetch": true, | |
// Do not ask for confirmation before syncing branches | |
"git.confirmSync": false, | |
// Commit all changes by default if there are no staged changes | |
"git.enableSmartCommit": true, | |
// Duh | |
"git.ignoreRebaseWarning": true, | |
// Disable default merge editor which is awful | |
"git.mergeEditor": false, | |
// In case of conflict between local and remote tags, replace local tags instead of failing to sync | |
"git.replaceTagsWhenPull": true, | |
// Tell GitHub Copilot how to help you better. My prompts: | |
"github.copilot.chat.codeGeneration.instructions": [ | |
{ "text": "Pay attention to how import paths are specified. In some projects, '.js' extension is required, in others it's not." }, | |
{ "text": "Use empty lines to separate logical blocks of code." }, | |
{ "text": "Use English and English only, unless prompted to do otherwise." }, | |
], | |
"github.copilot.chat.testGeneration.instructions": [ | |
{ "text": "Always use Vitest for unit tests, not Jest." }, | |
{ "text": "Remember that describe, expect, it and other test functions need to be imported from 'vitest'." }, | |
{ "text": "Import from 'vitest' should be the first import in the test file." }, | |
{ "text": "When working with @testing-library/react, prefer getting getBy*, queryBy*, findBy* methods from the object returned by render." }, | |
{ "text": "For clarity, avoid using getBy*, queryBy*, findBy* methods directly in expect() calls. Instead, assign them to a variable and use the variable in expect()." }, | |
{ "text": "When writing describe() method description, use '<FooComponent/> component' for React components and 'fooFunction()' for functions." }, | |
{ "text": "When writing it() method description, use 'should do foo given bar' format." }, | |
{ "text": "Prefer using `vi.mocked(someFunction)` over `someFunction as vi.Mock`." }, | |
{ "text": "Avoid mocking modules. If mock data is needed, guide me to create a fixture file." } | |
], | |
// Enables GitHub Copilot instruction files - placed in .github/copilot-instructions.md, enables sharing instructions between collaborators on each project | |
"github.copilot.chat.codeGeneration.useInstructionFiles": true, | |
// Enables GitHub Copilot Agent (public preview at the moment of writing) | |
"chat.agent.enabled": true, | |
// Enabled GitHub Copilot Next Edit Suggestions. Slightly annoying to some, but super helpful | |
"github.copilot.nextEditSuggestions.enabled": true, | |
// Disables telemetry | |
"editor.experimental.treeSitterTelemetry": false, | |
"gitlens.telemetry.enabled": false, | |
"redhat.telemetry.enabled": false, | |
"telemetry.telemetryLevel": "off", | |
// Configures terminal on macOS: use zsh, read .profile | |
"terminal.integrated.defaultProfile.osx": "zsh", | |
"terminal.integrated.profiles.osx": { | |
"zsh": { | |
"path": "zsh", | |
"args": [ | |
"-l" | |
] | |
} | |
}, | |
// Configures terminal on Windows: Use PowerShell, hide "welcome" information | |
"terminal.integrated.defaultProfile.windows": "PowerShell", | |
"terminal.integrated.profiles.windows": { | |
"PowerShell": { | |
"path": "pwsh.exe", | |
"args": [ | |
"-nologo" | |
], | |
"icon": "terminal-powershell" | |
} | |
}, | |
// Moves terminal tabs to the left | |
"terminal.integrated.tabs.location": "left", | |
// Disable updating imports on pasting; makes pasting too slow for my liking | |
"javascript.updateImportsOnPaste.enabled": false, | |
"typescript.updateImportsOnPaste.enabled": false, | |
// Disable auto-importing from node:test; use if you don't use builtin testing solution in Node.js, but rather Vitest or (who hurt you?) Jest | |
"typescript.preferences.autoImportFileExcludePatterns": [ | |
"node:test", | |
], | |
// Auto-import tends to often pull something from this directory | |
"typescript.preferences.autoImportSpecifierExcludeRegexes": [ | |
"^vitest/dist/.*$" | |
], | |
// My favorite theme | |
"workbench.colorTheme": "GitHub Dark", | |
// Editor associations | |
"workbench.editorAssociations": { | |
// Open SVG as code to edit, not as an image to view | |
"*.svg": "default", | |
}, | |
// Fixes tabs madness where all the tabs you have opened are called "index.js" or something, particularly in Next.js | |
"workbench.editor.customLabels.patterns": { | |
"**/page.{js,jsx,ts,tsx}": "${dirname}/${filename}.${extname}", | |
"**/layout.{js,jsx,ts,tsx}": "${dirname}/${filename}.${extname}", | |
"**/metadata.{js,jsx,ts,tsx}": "${dirname}/${filename}.${extname}", | |
"**/index.{js,jsx,ts,tsx}": "${dirname}/${filename}.${extname}", | |
"**/index.styles.{js,jsx,ts,tsx}": "${dirname}/${filename}.${extname}", | |
"**/index.spec.{js,jsx,ts,tsx}": "${dirname}/${filename}.${extname}", | |
"**/index.test.{js,jsx,ts,tsx}": "${dirname}/${filename}.${extname}", | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment