Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make files single quotes using eslint in VSCode

I'd like to make files be single-quotes on save without prettier and using only eslint or configuring basic VScode settings.

I've read that the .eslintrc.js needs to be edited to change double-quotes to single-quotes on save, but where is it located in VScode? I've tried searching in settings but could not find .eslintrc.js.

like image 767
dev_el Avatar asked Oct 30 '25 12:10

dev_el


1 Answers

This is working for me

My eslint.rc

{
     ... //other options
     "rules": {
        "quotes": [2, "single"]
      }
}

My vscode settings.json

{
   ...,
   "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
   "eslint.validate": [
      "typescript",
      "typescriptreact"
   ]
}
like image 97
Syed Jafri Avatar answered Nov 01 '25 08:11

Syed Jafri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!