VSCode/Prettier/EsLint adding spaces in optional chaining operator

Viewed 55

Not sure what's going on, but in VSCode w/ ESLint and Prettier turned on, it keeps converting lines like this var?.foo?.bar into var ? .foo ? .bar which then throws syntax errors... I have the following:

{
  "trailingComma": "all",
  "tabWidth": 2,
  "useTabs": false,
  "semi": false,
  "singleQuote": true
  }
{
  "extends": ["airbnb", "airbnb-typescript"],
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "parser": "@babel/eslint-parser",
  "rules": {
   "@typescript-eslint/semi": "off",
   "semi": "off",
   "import/prefer-default-export": "off",
   "no-unused-vars": ["error", { "argsIgnorePattern": "next" }],
   "react/react-in-jsx-scope": "off",
   "react/jsx-one-expression-per-line": "off",
   "react/jsx-props-no-spreading": "off",
   "jsx-a11y/label-has-associated-control": "off",
   "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
   "react/function-component-definition": "off",
   "react/require-default-props": "off",
   "no-param-reassign": "off"
  }
}

How do I stop VSCode from adding those spaces?

0 Answers
Related