Closed jcestibariz closed 3 years ago
+1
I think you should add that file in .eslintignore
@dohun-toss I'm sorry that's not acceptable. I need to lint my worker.
@jcestibariz Are you using eslint-loader
? I think you want to use enforce: pre
option.
But, if you give up enforce: pre
option, there are 2 alternatives: eslint-webpack-plugin
or changing order of two loaders.
module.exports = {
// ...
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader', 'eslint-loader'], // without enforce pre, you can use lint first
},
],
},
// ...
};
but, eslint-loader is deprecated. how about trying to migrate to eslint-webpack-plugin
?
Before:
module.exports = {
// ...
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
// eslint options (if necessary)
},
},
],
},
// ...
};
After:
const ESLintPlugin = require('eslint-webpack-plugin');
module.exports = {
// ...
plugins: [new ESLintPlugin(options)],
// ...
};
@dohun-toss I had not noticed that eslint-loader
was deprecated. Using eslint-webpack-plugin
fixed the problem, thank you!
I'm using Babel with
preset-env
for IE support (sad, I know), and I'm getting these errors:The warnings seem to be about code that would be injected by Babel, but ESLint runs with
enforce: pre
, so looks like double processing. This happens only for the worker the rest of the code is built correctly.Here's the (simplified) code for my worker:
This could be related to the problem reported in #86.