This format plugin for Atom IDE provides an interface to eslint. It will be used with files that have the "JavaScript" syntax.
apm install eslint-formateslint-format will look for a version of eslint local to your project and
use it if it's available. If none is found it will fall back to the version it
ships with.
Lets say you depend on a specific version of eslint, maybe it has unreleased
features, maybe it's just newer than what eslint-format ships with. If
your-project/node_modules/eslint exists eslint-format will be used.
This package requires an eslint of at least v1.0.0.
Note that you must have the atom-ide-ui package, or any package that consumes the
code-format.range
Service API,
installed for this to work.
You have two options:
-
Install locally to your project
eslintand the plugin$ npm i --save-dev eslint [eslint-plugins]
-
Install globally
eslintand plugins$ npm i -g eslint [eslint-plugins]- Activate
Use Global Eslintpackage option - (Optional) Set
Global Node Pathwith$ npm config get prefix
Note that recent versions of ESLint do not use any rules by-default. This means you have to specify a configuration file for your project!
To do this in a straightforward way run this:
eslint --initAlternatively you can create the .eslintrc.json file by yourself. It is a good
idea to have a look at the ESLint documentation,
including the list of rules.
Atom will try to find a local installation in the project folder, look if there's ESLint in ${PROJECT_ROOT}/node_modules and use it if found.
The path to the local node_modules folder can be a path relative to the project or an absolute path and should end in /node_modules/. This path is used if the other methods of discovery have failed.
If there is no local installation Atom will use the built-in ESLint in the eslint-format package itself.