-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
ESLintPlugin has no construct signatures #16
Comments
I don't have an env setup to easily replicate but just having briefly looked into it, it seems like:
Astoundingly, there is really not a lot of good information about this
@3bl3gamer Do you still get the error when using an |
No, But it does not work directly (some hacks are required) with |
With this: const ESLintPlugin = require('eslint-webpack-plugin');
module.exports = function (env) {
return {
plugins: [
new ESLintPlugin()
]
};
}; when I do this:
I get this:
|
"use strict";
const plugin = require('./index');
module.exports = plugin.default;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
...
var _default = ESLintWebpackPlugin;
exports.default = _default; |
Hey, I had the same issue but I was able to solve it: upgrade your eslint dependecy. |
I added a note about the eslint version |
It is still not fixed. I've created empty project with
tsconfig.json (same as above): {
"compilerOptions": {
"allowJs": true,
"checkJs": true
},
"exclude": ["node_modules", "dist"]
} webpack.config.js (same as above): const ESLintPlugin = require('eslint-webpack-plugin')
module.exports = {
plugins: [new ESLintPlugin({})], // <- error on "ESLintPlugin"
} TypeScript still outputs same error:
Same error in VSCode. According to type definitions, plugin should be imported as const { default: ESLintPlugin } = require("eslint-webpack-plugin")
// or
const { ESLintWebpackPlugin } = require("eslint-webpack-plugin") But when you actually run |
Hi, can we have this issue reopened? I am also having this issue. I am using the following package versions: I am executing webpack from its run API instead of the cli. When using the following:
which are transpiled to the following:
I get an error when executing webpack: When trying one of the imports below:
I get a TS error when instantiating the ESLintWebpackPlugin class: When directly requiring, however, I get no JS or TS errors, but I lose all typings on my source code editor:
|
Has anyone solved this issue yet? |
Expected Behavior
new ESLintPlugin({})
produce no errors.Actual Behavior
Code
The text was updated successfully, but these errors were encountered: