I want to avoid auto indent behaviour when I save a (javascript) file in Visual Studio Code without turning off complety auto indentation.
I have this code (and I would like to keep this indentation if possible):
const $tab_a = $('tab_a')
const $tab_b = $('tab_b')
;[$tab_a, $tab_b].forEach($e => $e.onclick = () => {
if ($e.className) return
$tab_a.classList.toggle('active')
$tab_b.classList.toggle('active')
})
However, every time I save with Visual Studio Code it changes indentation like this:
const $tab_a = $('tab_a')
const $tab_b = $('tab_b')
;[$tab_a, $tab_b].forEach($e => $e.onclick = () => {
if ($e.className) return
$tab_a.classList.toggle('active')
$tab_b.classList.toggle('active')
})
I tried different settings in Visual Studio Code:
- Editor: Auto Indent (default: full) -> none
- Editor: Wrapping Indent (default: same) -> none
- All combinations and restarting VSCode
Unfortunatly any of them worked for me.
Any help will be really appreciate it.
Note: I'm not using extensions.