Skip to content
Permalink
Browse files
Docs: Clarify Linter vs ESLint in node.js api docs (fixes #14953) (#1…
…4995)

* Improve clarity on the usage of the Linter class

* Fix MD issue

* Add line break for readability

* Update docs/developer-guide/nodejs-api.md

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
  • Loading branch information
Brian-Bartels and nzakas committed Aug 31, 2021
1 parent 80cfb8f commit 4165c7f937f5fc46d4209ae8f763238d73f37238
Showing with 2 additions and 1 deletion.
  1. +2 −1 docs/developer-guide/nodejs-api.md
@@ -458,7 +458,8 @@ const codeLines = SourceCode.splitLines(code);

## Linter

The `Linter` object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it simply parses and reports on the code. In particular, the `Linter` object does not process configuration objects or files.
The `Linter` object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it simply parses and reports on the code. In particular, the `Linter` object does not process configuration objects or files. Unless you are working in the browser, you probably want to use the [ESLint class](#eslint-class) class instead.

The `Linter` is a constructor, and you can create a new instance by passing in the options you want to use. The available options are:

* `cwd` - Path to a directory that should be considered as the current working directory. It is accessible to rules by calling `context.getCwd()` (see [The Context Object](./working-with-rules.md#the-context-object)). If `cwd` is `undefined`, it will be normalized to `process.cwd()` if the global `process` object is defined (for example, in the Node.js runtime) , or `undefined` otherwise.

0 comments on commit 4165c7f

Please sign in to comment.