linter.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @param {string|undefined} key
  3. * @param {Options} options
  4. * @param {Compilation} compilation
  5. * @returns {{lint: Linter, report: Reporter, threads: number}}
  6. */
  7. export default function linter(
  8. key: string | undefined,
  9. options: Options,
  10. compilation: Compilation
  11. ): {
  12. lint: Linter;
  13. report: Reporter;
  14. threads: number;
  15. };
  16. export type ESLint = import('eslint').ESLint;
  17. export type Formatter = import('eslint').ESLint.Formatter;
  18. export type LintResult = import('eslint').ESLint.LintResult;
  19. export type Compiler = import('webpack').Compiler;
  20. export type Compilation = import('webpack').Compilation;
  21. export type Source = import('webpack-sources/lib/Source');
  22. export type Options = import('./options').PluginOptions &
  23. import('eslint').ESLint.Options;
  24. export type FormatterFunction = (
  25. results: import('eslint').ESLint.LintResult[],
  26. data?: import('eslint').ESLint.LintResultData | undefined
  27. ) => string;
  28. export type GenerateReport = (compilation: Compilation) => Promise<void>;
  29. export type Report = {
  30. errors?: ESLintError | undefined;
  31. warnings?: ESLintError | undefined;
  32. generateReportAsset?: GenerateReport | undefined;
  33. };
  34. export type Reporter = () => Promise<Report>;
  35. export type Linter = (files: string | string[]) => void;
  36. export type LintResultMap = {
  37. [files: string]: import('eslint').ESLint.LintResult;
  38. };
  39. import ESLintError from './ESLintError';