Search code examples
typescripttsx

Why is code getting deleted on save (commad + s)?


I'm using VS Code as my IDE and this morning I noticed that when I hit command + s some code gets deleted. Specifically this from my index.tsx file:

import { Dialog, Disclosure, Transition } from '@headlessui/react';
import { InformationCircleIcon } from '@heroicons/react/20/solid';
import Head from 'next/head';
import Link from 'next/link';

Has anyone experienced something similar? I tried deleting the Prettier and Eslint plugins and nothings changed.

Thanks, Josh


Solution

  • The issue was this line of code in my settings.json file. I deleted it and that solved it:

    "files.associations": {
      "*.tsx": "typescript"
    },