How / where can I install the eslint configuration file in spacemacs

I have a project with eslint setup and I would like to use it in Spacemacs. Unfortunately, Spacemacs seems to be ignoring the .eslintrc.js file at the root of the project.

enter image description here

enter image description here

I'm on Windows 10 ...

Can anyone help?

+6
source share
2 answers

Spacemacs (and flycheck, an autocomplete plugin that interacts with eslint) do not look for eslint configurations, they delegate this to eslint itself. If you get this problem, it means that eslint itself throws an error when trying to load the configuration of your project.

Run eslint --print-config. from the directory of your project and eliminate all the errors that it displays, and this should fix it.

+6
source

I run mac setup, here is what worked for me:

Assuming you installed eslint , you can enable the syntax check in your ~/.spacemacs file


Start by typing SPC fed and uncommenting syntax-checking

 ;; spell-checking syntax-checking 
  • resynchronize the configuration by typing SPC fe R
  • open the javascript file in your project, which should have .eslintrc in its root directory
  • type SPC ev

Here you can confirm that javascript-eslint is enabled and that .eslintrc been detected for your project.

+4
source

Source: https://habr.com/ru/post/1260119/


All Articles