index.d.ts 1.1 KB

12345678910111213141516171819202122232425262728
  1. import { Plugin } from 'vite';
  2. import { ESLint } from 'eslint';
  3. /** Plugin options, extending from ESlint options */
  4. interface Options extends ESLint.Options {
  5. /** Path to ESLint instance that will be used for linting */
  6. eslintPath?: string;
  7. /** Check all matching files on project startup */
  8. lintOnStart?: boolean;
  9. /** A single file, or array of files, to include when linting */
  10. include?: string | string[];
  11. /** A single file, or array of files, to exclude when linting */
  12. exclude?: string | string[];
  13. /** Custom error formatter or the name of a built-in formatter */
  14. formatter?: string | ESLint.Formatter['format'];
  15. /** The warings found will be printed */
  16. emitWarning?: boolean;
  17. /** The errors found will be printed */
  18. emitError?: boolean;
  19. /** Will cause the module build to fail if there are any warnings, based on emitWarning */
  20. failOnWarning?: boolean;
  21. /** Will cause the module build to fail if there are any errors, based on emitError */
  22. failOnError?: boolean;
  23. }
  24. declare function eslintPlugin(rawOptions?: Options): Plugin;
  25. export { Options, eslintPlugin as default };