@@ -7,6 +7,7 @@ const getStylelint = require('./getStylelint');
77
88/** @typedef {import('stylelint') } Stylelint */
99/** @typedef {import('stylelint').LintResult } LintResult */
10+ /** @typedef {import('stylelint').InternalApi } InternalApi */
1011/** @typedef {import('webpack').Compiler } Compiler */
1112/** @typedef {import('webpack').Compilation } Compilation */
1213/** @typedef {import('./options').Options } Options */
@@ -25,12 +26,15 @@ const resultStorage = new WeakMap();
2526 * @param {string|undefined } key
2627 * @param {Options } options
2728 * @param {Compilation } compilation
28- * @returns {{lint: Linter, report: Reporter, threads: number} }
29+ * @returns {{api: InternalApi, lint: Linter, report: Reporter, threads: number} }
2930 */
3031function linter ( key , options , compilation ) {
3132 /** @type {Stylelint } */
3233 let stylelint ;
3334
35+ /** @type {InternalApi } */
36+ let api ;
37+
3438 /** @type {(files: string|string[]) => Promise<LintResult[]> } */
3539 let lintFiles ;
3640
@@ -46,13 +50,17 @@ function linter(key, options, compilation) {
4650 const crossRunResultStorage = getResultStorage ( compilation ) ;
4751
4852 try {
49- ( { stylelint, lintFiles, cleanup, threads } = getStylelint ( key , options ) ) ;
53+ ( { stylelint, api, lintFiles, cleanup, threads } = getStylelint (
54+ key ,
55+ options
56+ ) ) ;
5057 } catch ( e ) {
5158 throw new StylelintError ( e . message ) ;
5259 }
5360
5461 return {
5562 lint,
63+ api,
5664 report,
5765 threads,
5866 } ;
0 commit comments