DEV Community

Saurabh Sharma
Saurabh Sharma

Posted on

3 1

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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (5)

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

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 {}?

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay