Skip to content

Lint only the imported files #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions declarations/DirtyFileWatcher.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion declarations/ESLintError.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export default class ESLintError extends Error {
export default class ESLintError {
/**
* @param {string=} messages
*/
constructor(messages?: string | undefined);
name: string;
stack: string;
}
6 changes: 4 additions & 2 deletions declarations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ export type Options = {
quiet?: boolean | undefined;
outputReport?: import('./options').OutputReport | undefined;
};
/** @typedef {import('webpack').Compiler} Compiler */
/** @typedef {import('./options').Options} Options */
declare class ESLintWebpackPlugin {
/**
* @param {Options} options
*/
constructor(options?: Options);
options: import('./options').Options;
/**
* @param {Compiler} compiler
*/
run(compiler: Compiler): Promise<void>;
/**
* @param {Compiler} compiler
* @returns {void}
Expand Down
30 changes: 25 additions & 5 deletions declarations/linter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@
/** @typedef {import('eslint').ESLint.Formatter} Formatter */
/** @typedef {import('eslint').ESLint.LintResult} LintResult */
/** @typedef {import('webpack').Compiler} Compiler */
/** @typedef {import('webpack').compilation.Compilation} Compilation */
/** @typedef {import('webpack-sources').Source} Source */
/** @typedef {import('./options').Options} Options */
/** @typedef {import('./options').FormatterFunction} FormatterFunction */
/** @typedef {(compilation: Compilation) => Promise<void>} GenerateReport */
/** @typedef {{errors?: ESLintError, warnings?: ESLintError, generateReportAsset?: GenerateReport}} Report */
/** @typedef {() => Promise<Report>} Reporter */
/** @typedef {(files: string|string[]) => void} Linter */
/**
* @param {Options} options
* @param {Compiler} compiler
* @returns {Promise<void>}
* @returns {{lint: Linter, report: Reporter}}
*/
export default function linter(
options: Options,
compiler: Compiler
): Promise<void>;
options: Options
): {
lint: Linter;
report: Reporter;
};
export type ESLint = import('eslint').ESLint;
export type Formatter = import('eslint').ESLint.Formatter;
export type LintResult = import('eslint').ESLint.LintResult;
export type Compiler = import('webpack').Compiler;
export type Compilation = import('webpack').compilation.Compilation;
export type Source = import('webpack-sources/lib/Source');
export type Options = {
context?: string | undefined;
emitError?: boolean | undefined;
Expand All @@ -36,3 +45,14 @@ export type FormatterFunction = (
results: import('eslint').ESLint.LintResult[],
data?: import('eslint').ESLint.LintResultData | undefined
) => string;
export type GenerateReport = (compilation: Compilation) => Promise<void>;
export type Report = {
errors?: ESLintError | undefined;
warnings?: ESLintError | undefined;
generateReportAsset?:
| ((compilation: Compilation) => Promise<void>)
| undefined;
};
export type Reporter = () => Promise<Report>;
export type Linter = (files: string | string[]) => void;
import ESLintError from './ESLintError';
Loading