p7adams
p7adams

Reputation: 662

ESLint / VSCode. Eslint extension is not linting anything after opening new project inside VSCode

I'm using ESLint extension inside my VSCode editor. Extension is installed and after creating starter files of my React project, I'm doing:

eslint --init

inside my terminal. Then I choose AirBnb style guide with React. It creates .eslintrc.js file inside my project root folder.

ESLint is installed globally, but for the purposes of this issue I've also reinstalled localy inside my root folder like this:

npm install eslint --save-dev

Then I open my VSCode editor and extension is not linting any problems inside my files but I know there are some problems. Can it be related with .tsx extensions? I'm using TypeScript for the first time today. Do I have to use any extra packages to run up this? How to solve this?

I wanna mention that I had this problem before with other project, but there was no TypeScript - only .js and .jsx. Eslint extension was also not working, but suddenly during coding it started to run and warnings appears.

Upvotes: 2

Views: 24581

Answers (2)

TimDog
TimDog

Reputation: 8928

I had to run ./node_modules/.bin/eslint --init to somehow cause eslint to be reconfigured, even though I had everything installed/configured correctly.

Upvotes: 2

ibearkp
ibearkp

Reputation: 98

  1. Did you enable eslint extension for your workspace?
  2. If enabled but still not working, uninstall eslint extension and delete eslint folder in vscode directory then re-install eslint again and reload vscode.

worked for me.

Upvotes: 7

Related Questions