You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/developer-guide/nodejs-api.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -60,16 +60,16 @@ var linter = new Linter();
60
60
61
61
### Linter#verify
62
62
63
-
The most important method on `Linter` is `verify()`, which initiates linting of the given text. This method accepts four arguments:
63
+
The most important method on `Linter` is `verify()`, which initiates linting of the given text. This method accepts three arguments:
64
64
65
65
*`code` - the source code to lint (a string or instance of `SourceCode`).
66
66
*`config` - a configuration object that has been processed and normalized by CLIEngine using eslintrc files and/or other configuration arguments.
67
67
***Note**: If you want to lint text and have your configuration be read and processed, use CLIEngine's [`executeOnFiles`](#executeonfiles) or [`executeOnText`](#executeontext) instead.
68
-
*`optionsOrFilename` - (optional) Additional options for this run or a string representing the filename to associate with the code being linted.
68
+
*`options` - (optional) Additional options for this run.
69
69
*`filename` - (optional) the filename to associate with the source code.
70
-
*`saveState` - (optional) see below. This will override any value passed as the fourth argument if an options object is used here instead of the filename.
71
70
*`allowInlineConfig` - (optional) set to `false` to disable inline comments from changing eslint rules.
72
-
*`saveState` - (optional) set to true to maintain the internal state of `linter` after linting (mostly used for testing purposes)
71
+
72
+
If the third argument is a string, it is interpreted as the `filename`.
Copy file name to clipboardexpand all lines: lib/linter.js
+1-16
Original file line number
Diff line number
Diff line change
@@ -709,14 +709,6 @@ module.exports = class Linter {
709
709
this.environments=newEnvironments();
710
710
}
711
711
712
-
/**
713
-
* Resets the internal state of the object.
714
-
* @returns {void}
715
-
*/
716
-
reset(){
717
-
this.sourceCode=null;
718
-
}
719
-
720
712
/**
721
713
* Configuration object for the `verify` API. A JS representation of the eslintrc files.
722
714
* @typedef {Object} ESLintConfig
@@ -735,13 +727,11 @@ module.exports = class Linter {
735
727
* @param {(string|Object)} [filenameOrOptions] The optional filename of the file being checked.
736
728
* If this is not set, the filename will default to '<input>' in the rule context. If
737
729
* an object, then it has "filename", "saveState", and "allowInlineConfig" properties.
738
-
* @param {boolean} [saveState] Indicates if the state from the last run should be saved.
739
-
* Mostly useful for testing purposes.
740
730
* @param {boolean} [filenameOrOptions.allowInlineConfig] Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
741
731
* Useful if you want to validate JS without comments overriding rules.
742
732
* @returns {Object[]} The results as an array of messages or null if no messages.
0 commit comments