@@ -2,69 +2,126 @@ export type ESLintOptions = import("eslint").ESLint.Options;
22export type LintResult = import ( "eslint" ) . ESLint . LintResult ;
33export type FormatterFunction = ( results : LintResult [ ] ) => string ;
44export type OutputReport = {
5+ /**
6+ * a file path
7+ */
58 filePath ?: string | undefined ;
9+ /**
10+ * a formatter
11+ */
612 formatter ?: ( string | FormatterFunction ) | undefined ;
713} ;
814export type PluginOptions = {
15+ /**
16+ * a string indicating the root of your files
17+ */
918 context ?: string | undefined ;
19+ /**
20+ * the errors found will always be emitted
21+ */
1022 emitError ?: boolean | undefined ;
23+ /**
24+ * the warnings found will always be emitted
25+ */
1126 emitWarning ?: boolean | undefined ;
12- eslintPath ?: string | undefined ;
27+ /**
28+ * specify the files and/or directories to exclude
29+ */
1330 exclude ?: ( string | string [ ] ) | undefined ;
31+ /**
32+ * specify the extensions that should be checked
33+ */
1434 extensions ?: ( string | string [ ] ) | undefined ;
35+ /**
36+ * will cause the module build to fail if there are any errors
37+ */
1538 failOnError ?: boolean | undefined ;
39+ /**
40+ * will cause the module build to fail if there are any warning
41+ */
1642 failOnWarning ?: boolean | undefined ;
43+ /**
44+ * specify directories, files, or globs
45+ */
1746 files ?: ( string | string [ ] ) | undefined ;
47+ /**
48+ * apply fixes
49+ */
1850 fix ?: boolean | undefined ;
51+ /**
52+ * specify the formatter you would like to use to format your results
53+ */
1954 formatter ?: ( string | FormatterFunction ) | undefined ;
55+ /**
56+ * lint only changed files, skip linting on start
57+ */
2058 lintDirtyModulesOnly ?: boolean | undefined ;
59+ /**
60+ * will process and report errors only and ignore warnings
61+ */
2162 quiet ?: boolean | undefined ;
63+ /**
64+ * path to `eslint` instance that will be used for linting
65+ */
66+ eslintPath ?: string | undefined ;
67+ /**
68+ * writes the output of the errors to a file - for example, a `json` file for use for reporting
69+ */
2270 outputReport ?: OutputReport | undefined ;
71+ /**
72+ * number of worker threads
73+ */
2374 threads ?: ( number | boolean ) | undefined ;
75+ /**
76+ * Specify the resource query to exclude
77+ */
2478 resourceQueryExclude ?: ( RegExp | RegExp [ ] ) | undefined ;
79+ /**
80+ * config type
81+ */
2582 configType ?: string | undefined ;
2683} ;
2784export type Options = PluginOptions & ESLintOptions ;
85+ /**
86+ * @param {Options } loaderOptions loader options
87+ * @returns {ESLintOptions } eslint options
88+ */
89+ export function getESLintOptions ( loaderOptions : Options ) : ESLintOptions ;
2890/** @typedef {import("eslint").ESLint.Options } ESLintOptions */
2991/** @typedef {import('eslint').ESLint.LintResult } LintResult */
3092/**
3193 * @callback FormatterFunction
32- * @param {LintResult[] } results
33- * @returns {string }
94+ * @param {LintResult[] } results results
95+ * @returns {string } formatted result
3496 */
3597/**
36- * @typedef {Object } OutputReport
37- * @property {string= } filePath
38- * @property {string| FormatterFunction= } formatter
98+ * @typedef {object } OutputReport
99+ * @property {string= } filePath a file path
100+ * @property {string | FormatterFunction= } formatter a formatter
39101 */
40102/**
41- * @typedef {Object } PluginOptions
42- * @property {string= } context
43- * @property {boolean= } emitError
44- * @property {boolean= } emitWarning
45- * @property {string= } eslintPath
46- * @property {string| string[]= } exclude
47- * @property {string|string[] = } extensions
48- * @property {boolean= } failOnError
49- * @property {boolean = } failOnWarning
50- * @property {string|string[] = } files
51- * @property {boolean = } fix
52- * @property {string|FormatterFunction = } formatter
53- * @property {boolean= } lintDirtyModulesOnly
54- * @property {boolean = } quiet
55- * @property {OutputReport= } outputReport
56- * @property {number| boolean= } threads
57- * @property {RegExp| RegExp[]= } resourceQueryExclude
58- * @property {string= } configType
103+ * @typedef {object } PluginOptions
104+ * @property {string= } context a string indicating the root of your files
105+ * @property {boolean= } emitError the errors found will always be emitted
106+ * @property {boolean= } emitWarning the warnings found will always be emitted
107+ * @property {string | string[] = } exclude specify the files and/or directories to exclude
108+ * @property {string | string[]= } extensions specify the extensions that should be checked
109+ * @property {boolean = } failOnError will cause the module build to fail if there are any errors
110+ * @property {boolean= } failOnWarning will cause the module build to fail if there are any warning
111+ * @property {string | string[] = } files specify directories, files, or globs
112+ * @property {boolean = } fix apply fixes
113+ * @property {string | FormatterFunction = } formatter specify the formatter you would like to use to format your results
114+ * @property {boolean = } lintDirtyModulesOnly lint only changed files, skip linting on start
115+ * @property {boolean= } quiet will process and report errors only and ignore warnings
116+ * @property {string = } eslintPath path to `eslint` instance that will be used for linting
117+ * @property {OutputReport= } outputReport writes the output of the errors to a file - for example, a `json` file for use for reporting
118+ * @property {number | boolean= } threads number of worker threads
119+ * @property {RegExp | RegExp[]= } resourceQueryExclude Specify the resource query to exclude
120+ * @property {string= } configType config type
59121 */
60122/** @typedef {PluginOptions & ESLintOptions } Options */
61123/**
62- * @param {Options } pluginOptions
63- * @returns {PluginOptions }
124+ * @param {Options } pluginOptions plugin options
125+ * @returns {PluginOptions } normalized plugin options
64126 */
65127export function getOptions ( pluginOptions : Options ) : PluginOptions ;
66- /**
67- * @param {Options } loaderOptions
68- * @returns {ESLintOptions }
69- */
70- export function getESLintOptions ( loaderOptions : Options ) : ESLintOptions ;
0 commit comments