#1979·standard

Bad indent when use switch case

Author: ssheduardoCreated Feb 5, 2025Updated Feb 6, 2025

I have vscode clear, only with eslint, prettier (disabled global in vscode to test). The problem is when create a simple file JS with switch, if save or apply eslint fix in the terminal, the indent level beetween switch and case, same level, that no indent correctly if I try indent manually, the standard mark error.

Image

Image

This is my .eslintrc.json

{
  "extends": ["standard"],
  "rules": {
    "semi": ["error", "never"], // No usar punto y coma
    "quotes": ["error", "single"], // Usar comillas simples
    "space-before-function-paren": ["error", "always"],
    "indent": ["error", 2]
  }
}

Part of my package.json

  "devDependencies": {
    "eslint": "^8.57.1",
    "eslint-config-standard": "^17.1.0",
    "standard": "^17.1.2"
  },
  "eslintConfig": {
    "extends": "standard"
  },

This is my settings.json

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },

  "editor.formatOnSave": false,

  "[javascript]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },

  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[markdown]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
 
  "[php]": {
    "editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
  },

  "[blade]": {
    "editor.defaultFormatter": "onecentlin.laravel-blade"
  },
  "files.eol": "\n",
  "tailwindCSS.emmetCompletions": true,
  "eslint.alwaysShowStatus": true,
  "editor.largeFileOptimizations": true,
  "workbench.iconTheme": "material-icon-theme",
  "files.autoSave": "onFocusChange",
  "editor.tabSize": 2
}

Where is wrong, I deleted all my plugin and configurations of Vscode and starting again.

Sorry by my English.