For #emacs #frontend users who use web-mode with lsp-mode. Here is how you fix indentation when working with Vue/React/Svelte files:
(add-hook 'web-mode-hook
(lambda ()
(setq-local lsp-enable-indentation nil)))
This disables the LSP indentation, which overrides web-mode's indentation configuration. Now web-mode should indent things with 2 spaces with the configuration below:
(setq web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
web-mode-script-padding 2
web-mode-style-padding 2)