.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / @typescript-eslint / experimental-utils / _ts3.4 / dist / ts-eslint / CLIEngine.d.ts
1 import { Linter } from './Linter';\r
2 import { RuleListener, RuleMetaData, RuleModule } from './Rule';\r
3 declare class CLIEngineBase {\r
4     /**\r
5      * Creates a new instance of the core CLI engine.\r
6      * @param providedOptions The options for this instance.\r
7      */\r
8     constructor(options: CLIEngine.Options);\r
9     /**\r
10      * Add a plugin by passing its configuration\r
11      * @param name Name of the plugin.\r
12      * @param pluginObject Plugin configuration object.\r
13      */\r
14     addPlugin(name: string, pluginObject: Linter.Plugin): void;\r
15     /**\r
16      * Executes the current configuration on an array of file and directory names.\r
17      * @param patterns An array of file and directory names.\r
18      * @returns The results for all files that were linted.\r
19      */\r
20     executeOnFiles(patterns: string[]): CLIEngine.LintReport;\r
21     /**\r
22      * Executes the current configuration on text.\r
23      * @param text A string of JavaScript code to lint.\r
24      * @param filename An optional string representing the texts filename.\r
25      * @param warnIgnored Always warn when a file is ignored\r
26      * @returns The results for the linting.\r
27      */\r
28     executeOnText(text: string, filename?: string, warnIgnored?: boolean): CLIEngine.LintReport;\r
29     /**\r
30      * Returns a configuration object for the given file based on the CLI options.\r
31      * This is the same logic used by the ESLint CLI executable to determine configuration for each file it processes.\r
32      * @param filePath The path of the file to retrieve a config object for.\r
33      * @returns A configuration object for the file.\r
34      */\r
35     getConfigForFile(filePath: string): Linter.Config;\r
36     /**\r
37      * Returns the formatter representing the given format.\r
38      * @param format The name of the format to load or the path to a custom formatter.\r
39      * @returns The formatter function.\r
40      */\r
41     getFormatter(format?: string): CLIEngine.Formatter;\r
42     /**\r
43      * Checks if a given path is ignored by ESLint.\r
44      * @param filePath The path of the file to check.\r
45      * @returns Whether or not the given path is ignored.\r
46      */\r
47     isPathIgnored(filePath: string): boolean;\r
48     /**\r
49      * Resolves the patterns passed into `executeOnFiles()` into glob-based patterns for easier handling.\r
50      * @param patterns The file patterns passed on the command line.\r
51      * @returns The equivalent glob patterns.\r
52      */\r
53     resolveFileGlobPatterns(patterns: string[]): string[];\r
54     getRules<TMessageIds extends string = string, TOptions extends readonly unknown[] = unknown[], TRuleListener extends RuleListener = RuleListener>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;\r
55     /**\r
56      * Returns results that only contains errors.\r
57      * @param results The results to filter.\r
58      * @returns The filtered results.\r
59      */\r
60     static getErrorResults(results: CLIEngine.LintResult[]): CLIEngine.LintResult[];\r
61     /**\r
62      * Returns the formatter representing the given format or null if the `format` is not a string.\r
63      * @param format The name of the format to load or the path to a custom formatter.\r
64      * @returns The formatter function.\r
65      */\r
66     static getFormatter(format?: string): CLIEngine.Formatter;\r
67     /**\r
68      * Outputs fixes from the given results to files.\r
69      * @param report The report object created by CLIEngine.\r
70      */\r
71     static outputFixes(report: CLIEngine.LintReport): void;\r
72     static version: string;\r
73 }\r
74 declare namespace CLIEngine {\r
75     interface Options {\r
76         allowInlineConfig?: boolean;\r
77         baseConfig?: false | {\r
78             [name: string]: unknown;\r
79         };\r
80         cache?: boolean;\r
81         cacheFile?: string;\r
82         cacheLocation?: string;\r
83         configFile?: string;\r
84         cwd?: string;\r
85         envs?: string[];\r
86         errorOnUnmatchedPattern?: boolean;\r
87         extensions?: string[];\r
88         fix?: boolean;\r
89         globals?: string[];\r
90         ignore?: boolean;\r
91         ignorePath?: string;\r
92         ignorePattern?: string | string[];\r
93         useEslintrc?: boolean;\r
94         parser?: string;\r
95         parserOptions?: Linter.ParserOptions;\r
96         plugins?: string[];\r
97         resolvePluginsRelativeTo?: string;\r
98         rules?: {\r
99             [name: string]: Linter.RuleLevel | Linter.RuleLevelAndOptions;\r
100         };\r
101         rulePaths?: string[];\r
102         reportUnusedDisableDirectives?: boolean;\r
103     }\r
104     interface LintResult {\r
105         filePath: string;\r
106         messages: Linter.LintMessage[];\r
107         errorCount: number;\r
108         warningCount: number;\r
109         fixableErrorCount: number;\r
110         fixableWarningCount: number;\r
111         output?: string;\r
112         source?: string;\r
113     }\r
114     interface LintReport {\r
115         results: LintResult[];\r
116         errorCount: number;\r
117         warningCount: number;\r
118         fixableErrorCount: number;\r
119         fixableWarningCount: number;\r
120         usedDeprecatedRules: DeprecatedRuleUse[];\r
121     }\r
122     interface DeprecatedRuleUse {\r
123         ruleId: string;\r
124         replacedBy: string[];\r
125     }\r
126     interface LintResultData<TMessageIds extends string> {\r
127         rulesMeta: {\r
128             [ruleId: string]: RuleMetaData<TMessageIds>;\r
129         };\r
130     }\r
131     type Formatter = <TMessageIds extends string>(results: LintResult[], data?: LintResultData<TMessageIds>) => string;\r
132 }\r
133 declare const CLIEngine_base: typeof CLIEngineBase;\r
134 /**\r
135  * The underlying utility that runs the ESLint command line interface. This object will read the filesystem for\r
136  * configuration and file information but will not output any results. Instead, it allows you direct access to the\r
137  * important information so you can deal with the output yourself.\r
138  * @deprecated use the ESLint class instead\r
139  */\r
140 declare class CLIEngine extends CLIEngine_base {\r
141 }\r
142 export { CLIEngine };\r
143 //# sourceMappingURL=CLIEngine.d.ts.map\r