Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion declarations/cjs.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
declare const _exports: typeof import('.').ESLintWebpackPlugin;
declare const _exports: typeof import('.').default;
export = _exports;
10 changes: 5 additions & 5 deletions declarations/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export class ESLintWebpackPlugin {
export default ESLintWebpackPlugin;
export type Compiler = import('webpack').Compiler;
export type Options = import('./options').PluginOptions &
import('eslint').ESLint.Options;
declare class ESLintWebpackPlugin {
/**
* @param {Options} options
*/
Expand All @@ -20,7 +24,3 @@ export class ESLintWebpackPlugin {
*/
getContext(compiler: Compiler): string;
}
export default ESLintWebpackPlugin;
export type Compiler = import('webpack').Compiler;
export type Options = import('./options').PluginOptions &
import('eslint').ESLint.Options;
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { parseFiles, parseFoldersToGlobs } from './utils';

const ESLINT_PLUGIN = 'ESLintWebpackPlugin';

export class ESLintWebpackPlugin {
class ESLintWebpackPlugin {
/**
* @param {Options} options
*/
Expand Down
4 changes: 2 additions & 2 deletions src/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function linter(options, compilation) {
const { outputReport } = options;
// @ts-ignore
const save = (name, content) =>
new Promise((finish, bail) => {
/** @type {Promise<void>} */ (new Promise((finish, bail) => {
const { mkdir, writeFile } = compiler.outputFileSystem;
// ensure directory exists
// @ts-ignore - the types for `outputFileSystem` are missing the 3 arg overload
Expand All @@ -128,7 +128,7 @@ export default function linter(options, compilation) {
else finish();
});
});
});
}));

if (!outputReport || !outputReport.filePath) {
return;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"checkJs": true,
"strict": true,
"types": ["node"],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"include": ["./src/**/*"]
Expand Down