|
| 1 | +/** @typedef {import("eslint").ESLint.Options} ESLintOptions */ |
| 2 | +/** @typedef {import('eslint').ESLint.LintResult} LintResult */ |
| 3 | +/** @typedef {import('eslint').ESLint.LintResultData} LintResultData */ |
| 4 | +/** |
| 5 | + * @callback FormatterFunction |
| 6 | + * @param {LintResult[]} results |
| 7 | + * @param {LintResultData=} data |
| 8 | + * @returns {string} |
| 9 | + */ |
| 10 | +/** |
| 11 | + * @typedef {Object} OutputReport |
| 12 | + * @property {string=} filePath |
| 13 | + * @property {string|FormatterFunction=} formatter |
| 14 | + */ |
| 15 | +/** |
| 16 | + * @typedef {Object} Options |
| 17 | + * @property {string=} context |
| 18 | + * @property {boolean=} emitError |
| 19 | + * @property {boolean=} emitWarning |
| 20 | + * @property {string=} eslintPath |
| 21 | + * @property {boolean=} failOnError |
| 22 | + * @property {boolean=} failOnWarning |
| 23 | + * @property {string|string[]=} files |
| 24 | + * @property {string|string[]=} extensions |
| 25 | + * @property {boolean=} fix |
| 26 | + * @property {string|FormatterFunction=} formatter |
| 27 | + * @property {boolean=} lintDirtyModulesOnly |
| 28 | + * @property {boolean=} quiet |
| 29 | + * @property {OutputReport=} outputReport |
| 30 | + */ |
| 31 | +/** |
| 32 | + * @param {Options} pluginOptions |
| 33 | + * @returns {Options} |
| 34 | + */ |
| 35 | +export function getOptions(pluginOptions: Options): Options; |
| 36 | +/** |
| 37 | + * @param {Options} loaderOptions |
| 38 | + * @returns {ESLintOptions} |
| 39 | + */ |
| 40 | +export function getESLintOptions(loaderOptions: Options): ESLintOptions; |
| 41 | +export type ESLintOptions = import('eslint').ESLint.Options; |
| 42 | +export type LintResult = import('eslint').ESLint.LintResult; |
| 43 | +export type LintResultData = import('eslint').ESLint.LintResultData; |
| 44 | +export type FormatterFunction = ( |
| 45 | + results: LintResult[], |
| 46 | + data?: LintResultData | undefined |
| 47 | +) => string; |
| 48 | +export type OutputReport = { |
| 49 | + filePath?: string | undefined; |
| 50 | + formatter?: (string | FormatterFunction) | undefined; |
| 51 | +}; |
| 52 | +export type Options = { |
| 53 | + context?: string | undefined; |
| 54 | + emitError?: boolean | undefined; |
| 55 | + emitWarning?: boolean | undefined; |
| 56 | + eslintPath?: string | undefined; |
| 57 | + failOnError?: boolean | undefined; |
| 58 | + failOnWarning?: boolean | undefined; |
| 59 | + files?: (string | string[]) | undefined; |
| 60 | + extensions?: (string | string[]) | undefined; |
| 61 | + fix?: boolean | undefined; |
| 62 | + formatter?: (string | FormatterFunction) | undefined; |
| 63 | + lintDirtyModulesOnly?: boolean | undefined; |
| 64 | + quiet?: boolean | undefined; |
| 65 | + outputReport?: OutputReport | undefined; |
| 66 | +}; |
0 commit comments