2

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.

3
  • Just a thought, the python linter only checks the document once you've hit save and doesn't recheck until you save again. Perhaps eslint is the same way... Are your changes unsaved? Commented Jan 13, 2018 at 16:55
  • All changes are saved.
    – p7adams
    Commented Jan 13, 2018 at 17:32
  • Does this answer your question? ESLint not working in VS Code?
    – T.Todua
    Commented Jan 25, 2022 at 13:31

2 Answers 2

7
  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.

0
2

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

1
  • 1
    This worked for me. I had run npm install, uninstalled and installed the extension, several times. The linter still did nothing. I ran this command in the terminal and it prompted me with a bunch of config questions, then created an .eslintrc.json file in the project root and voila! The linter started working.
    – Mike K
    Commented Jul 7, 2023 at 18:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.