DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Saurabh Sharma
Saurabh Sharma

Posted on

can you help me to set-up eslint in vs code

I tried it a lot of times now, I thought it's a lot better to ask someone else.

Error message:

Cannot read config file: C:\Users\itsjzt\.eslintrc.json Error: Unexpected token οΏ½ in JSON at position 0
Enter fullscreen mode Exit fullscreen mode

Settings:

{
  "editor.tabSize": 2,
  "files.eol": "\n",
  "files.trimTrailingWhitespace": true,
  "workbench.colorTheme": "Dracula",
  "editor.minimap.enabled": false,
  "workbench.iconTheme": "material-icon-theme",
  "terminal.integrated.fontSize": 16,
  "eslint.packageManager": "yarn",
  "eslint.options": { "configFile": "C:\\Users\\itsjzt\\.eslintrc.json" }
}

Enter fullscreen mode Exit fullscreen mode

plugins:

dbaeumer.vscode-eslint
dracula-theme.theme-dracula
lukehoban.Go
PKief.material-icon-theme
WakaTime.vscode-wakatime
WallabyJs.quokka-vscode
Enter fullscreen mode Exit fullscreen mode

.eslintrc.json

{
  "extends": "airbnb"
}
Enter fullscreen mode Exit fullscreen mode

OS: Windows 10 1709

Top comments (5)

Collapse
 
andy profile image
Andy Zhao (he/him) • Edited on

Also, I think we used this guide to set up ESLint with Airbnb flavor:
travishorn.com/setting-up-eslint-o...

@maestromac would be able to confirm.

Any reason you're not using npm to configure your ESLint?

Collapse
 
itsjzt profile image
Saurabh Sharma

got the problem, it was due to some weird file format.

I didn't know how to make a global .eslintrc, so I googled and copy pasted the config.

Collapse
 
andy profile image
Andy Zhao (he/him)

Hmm interesting. Might be a Windows thing. I always had issues creating irregular file extensions with Windows. Glad you figured it out though.

Thread Thread
 
itsjzt profile image
Saurabh Sharma

Sometimes Windows sucks

Collapse
 
andy profile image
Andy Zhao (he/him)

Hmm what happens if you change .eslintrc.json to an empty object {}?

We are hiring! Do you want to be our Senior Platform Engineer? Are you capable of chipping in across sysadmin, ops, and site reliability work, while supporting the open source stack that runs DEV and other communities?

This role might just be for you!

Apply now