Skip to content

Commit 8287872

Browse files
Fix types (#42)
* fix: types * fix: export class * docs: update note about eslint version
1 parent dc2fac7 commit 8287872

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module.exports = {
6969
npm install eslint-webpack-plugin --save-dev
7070
```
7171

72-
**Note**: You also need to install `eslint` from npm, if you haven't already:
72+
**Note**: You also need to install `eslint >= 7` from npm, if you haven't already:
7373

7474
```bash
7575
npm install eslint --save-dev

declarations/cjs.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
declare const _exports: typeof import('.').default;
1+
declare const _exports: typeof import('.').ESLintWebpackPlugin;
22
export = _exports;

declarations/index.d.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
1-
export default ESLintWebpackPlugin;
2-
export type Compiler = import('webpack').Compiler;
3-
export type Options = {
4-
context?: string | undefined;
5-
emitError?: boolean | undefined;
6-
emitWarning?: boolean | undefined;
7-
eslintPath?: string | undefined;
8-
exclude?: string | string[] | undefined;
9-
extensions?: string | string[] | undefined;
10-
failOnError?: boolean | undefined;
11-
failOnWarning?: boolean | undefined;
12-
files?: string | string[] | undefined;
13-
fix?: boolean | undefined;
14-
formatter?: string | import('./options').FormatterFunction | undefined;
15-
lintDirtyModulesOnly?: boolean | undefined;
16-
quiet?: boolean | undefined;
17-
outputReport?: import('./options').OutputReport | undefined;
18-
};
19-
declare class ESLintWebpackPlugin {
1+
export class ESLintWebpackPlugin {
202
/**
213
* @param {Options} options
224
*/
@@ -38,3 +20,21 @@ declare class ESLintWebpackPlugin {
3820
*/
3921
getContext(compiler: Compiler): string;
4022
}
23+
export default ESLintWebpackPlugin;
24+
export type Compiler = import('webpack').Compiler;
25+
export type Options = {
26+
context?: string | undefined;
27+
emitError?: boolean | undefined;
28+
emitWarning?: boolean | undefined;
29+
eslintPath?: string | undefined;
30+
exclude?: string | string[] | undefined;
31+
extensions?: string | string[] | undefined;
32+
failOnError?: boolean | undefined;
33+
failOnWarning?: boolean | undefined;
34+
files?: string | string[] | undefined;
35+
fix?: boolean | undefined;
36+
formatter?: string | import('./options').FormatterFunction | undefined;
37+
lintDirtyModulesOnly?: boolean | undefined;
38+
quiet?: boolean | undefined;
39+
outputReport?: import('./options').OutputReport | undefined;
40+
};

declarations/utils.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ export function replaceBackslashes(str: string): string;
1616
*/
1717
export function parseFoldersToGlobs(
1818
patterns: string | string[],
19-
extensions: string | string[]
19+
extensions?: string | string[]
2020
): string[];

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { parseFiles, parseFoldersToGlobs } from './utils';
1212

1313
const ESLINT_PLUGIN = 'ESLintWebpackPlugin';
1414

15-
class ESLintWebpackPlugin {
15+
export class ESLintWebpackPlugin {
1616
/**
1717
* @param {Options} options
1818
*/

0 commit comments

Comments
 (0)