-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-emit-warning-error-quiet
- Loading branch information
Showing
24 changed files
with
4,887 additions
and
5,364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,40 @@ | ||
/** @typedef {import('eslint').ESLint} ESLint */ | ||
/** @typedef {import('eslint').ESLint.LintResult} LintResult */ | ||
/** @typedef {import('./options').Options} Options */ | ||
/** @typedef {() => Promise<void>} AsyncTask */ | ||
/** @typedef {(files: string|string[]) => Promise<LintResult[]>} LintTask */ | ||
/** @typedef {JestWorker & {lintFiles: LintTask}} Worker */ | ||
/** @typedef {{threads: number, ESLint: ESLint, eslint: ESLint, lintFiles: LintTask, cleanup: AsyncTask}} Linter */ | ||
/** | ||
* @param {Options} options | ||
* @returns {{ESLint: ESLint, eslint: ESLint}} | ||
* @returns {Linter} | ||
*/ | ||
export default function getESLint( | ||
options: Options | ||
): { | ||
ESLint: import('eslint').ESLint; | ||
eslint: import('eslint').ESLint; | ||
}; | ||
export function loadESLint(options: Options): Linter; | ||
/** | ||
* @param {number} poolSize | ||
* @param {Options} options | ||
* @returns {Linter} | ||
*/ | ||
export function loadESLintThreaded(poolSize: number, options: Options): Linter; | ||
/** | ||
* @param {Options} options | ||
* @returns {Linter} | ||
*/ | ||
export default function getESLint({ threads, ...options }: Options): Linter; | ||
export type ESLint = import('eslint').ESLint; | ||
export type Options = { | ||
context?: string | undefined; | ||
emitError?: boolean | undefined; | ||
emitWarning?: boolean | undefined; | ||
eslintPath?: string | undefined; | ||
exclude?: string | string[] | undefined; | ||
extensions?: string | string[] | undefined; | ||
failOnError?: boolean | undefined; | ||
failOnWarning?: boolean | undefined; | ||
files?: string | string[] | undefined; | ||
fix?: boolean | undefined; | ||
formatter?: string | import('./options').FormatterFunction | undefined; | ||
lintDirtyModulesOnly?: boolean | undefined; | ||
quiet?: boolean | undefined; | ||
outputReport?: import('./options').OutputReport | undefined; | ||
export type LintResult = import('eslint').ESLint.LintResult; | ||
export type Options = import('./options').PluginOptions & | ||
import('eslint').ESLint.Options; | ||
export type AsyncTask = () => Promise<void>; | ||
export type LintTask = (files: string | string[]) => Promise<LintResult[]>; | ||
export type Worker = JestWorker & { | ||
lintFiles: LintTask; | ||
}; | ||
export type Linter = { | ||
threads: number; | ||
ESLint: ESLint; | ||
eslint: ESLint; | ||
lintFiles: LintTask; | ||
cleanup: AsyncTask; | ||
}; | ||
import JestWorker from 'jest-worker'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type setupOptions = { | ||
/** | ||
* - import path of eslint | ||
*/ | ||
eslintPath?: string | undefined; | ||
/** | ||
* - linter options | ||
*/ | ||
eslintOptions?: ESLintOptions | undefined; | ||
}; | ||
export type ESLint = import('eslint').ESLint; | ||
export type ESLintOptions = import('eslint').ESLint.Options; |
Oops, something went wrong.