S
S
semennn2017-12-09 02:02:44
Linter
semennn, 2017-12-09 02:02:44

How to install eslint?

Hello! Help a newbie!
How to install eslint on local machine? For example, in the editor Notepad ++.
I found the plugin at sourceforge.net/projects/notepad-linter/, downloaded it, added it to the plugins folder.
I open the "Plugins-Linter-Edit config" tab, an empty linter.xml file opens.
What to do next? Need to look for a list of rules and manually add to this file?
Or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2017-12-09
@semennn

1. You need to install Eslint itself depending on the project (it is usually not installed globally):
2. If necessary, install configs and plugins.
I advise you to install the eslint-config-airbnb config and the eslint-plugin-prettier plugin .
3. If you use Flow or experimental JS features, install the babel-eslint parser .
4. Create a .eslintrc rules file . Example:

{
  "extends": [
    "airbnb",
    "prettier",
  ],
  "plugins": [
    "prettier"
  ],
  "parser": "babel-eslint",
  "rules": {
      /* тут пишите правила, 
       * так же при использовании конфигов,
       *  вам скорей всего захочется какие-то 
       * правила, используемые в них, отключить,
       * это можно сделать тут
       */
  }
}

5. Set the path to Eslint and the configuration file in your IDE , Webstorm finds the configuration and local ESLint in the project itself. Look for how to do this in NotePad++ yourself, most likely there is a configuration guide and full documentation in the repository or on the plug-in website.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question