linter.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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 Options = import('./options').Options;
  22. export type FormatterFunction = import('./options').FormatterFunction;
  23. export type GenerateReport = (compilation: Compilation) => Promise<void>;
  24. export type Report = {
  25. errors?: ESLintError;
  26. warnings?: ESLintError;
  27. generateReportAsset?: GenerateReport;
  28. };
  29. export type Reporter = () => Promise<Report>;
  30. export type Linter = (files: string | string[]) => void;
  31. export type LintResultMap = {
  32. [files: string]: import('eslint').ESLint.LintResult;
  33. };
  34. import ESLintError from './ESLintError';