]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/developer-guide/nodejs-api.md
import eslint 7.28.0
[pve-eslint.git] / eslint / docs / developer-guide / nodejs-api.md
index cfa03721876243c9b444a4ce7d4d37d0259c3a0a..f1e21584e326c3b9f444db7f5d12a90a9c9959b6 100644 (file)
@@ -21,15 +21,15 @@ While ESLint is designed to be run on the command line, it's possible to use ESL
     * [EditInfo type][editinfo]
     * [Formatter type][formatter]
 * [SourceCode](#sourcecode)
-    * [splitLines()](#sourcecode-splitlines)
+    * [splitLines()](#sourcecodesplitlines)
 * [Linter](#linter)
-    * [verify()](#linter-verify)
-    * [verifyAndFix()](#linter-verifyandfix)
-    * [defineRule()](#linter-definerule)
-    * [defineRules()](#linter-definerules)
-    * [getRules()](#linter-getrules)
-    * [defineParser()](#linter-defineparser)
-    * [version](#linter-version)
+    * [verify()](#linterverify)
+    * [verifyAndFix()](#linterverifyandfix)
+    * [defineRule()](#linterdefinerule)
+    * [defineRules()](#linterdefinerules)
+    * [getRules()](#lintergetrules)
+    * [defineParser()](#linterdefineparser)
+    * [version](#linterversionlinterversion)
 * [linter (deprecated)](#linter-1)
 * [CLIEngine (deprecated)](#cliengine)
 * [RuleTester](#ruletester)
@@ -156,6 +156,8 @@ The `ESLint` constructor takes an `options` object. If you omit the `options` ob
   Default is `false`. If `true` is present, the [`eslint.lintFiles()`][eslint-lintfiles] method caches lint results and uses it if each target file is not changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have to remove the cache file manually. The [`eslint.lintText()`][eslint-linttext] method doesn't use caches even if you pass the `options.filePath` to the method.
 * `options.cacheLocation` (`string`)<br>
   Default is `.eslintcache`. The [`eslint.lintFiles()`][eslint-lintfiles] method writes caches into this file.
+* `options.cacheStrategy` (`string`)<br>
+  Default is `"metadata"`. Strategy for the cache to use for detecting changed files. Can be either `"metadata"` or `"content"`.
 
 ### ◆ eslint.lintFiles(patterns)
 
@@ -351,6 +353,8 @@ The `LintMessage` value is the information of each linting error. The `messages`
   The rule name that generates this lint message. If this message is generated by the ESLint core rather than rules, this is `null`.
 * `severity` (`1 | 2`)<br>
   The severity of this message. `1` means warning and `2` means error.
+* `fatal` (`boolean | undefined`)<br>
+  `true` if this is a fatal error unrelated to a rule, like a parsing error.
 * `message` (`string`)<br>
   The error message.
 * `line` (`number`)<br>