So I was facing an issue with eslint in my react app and I was able to solve it after ejecting the app and added some options to the ESLintPlugin in the webpack.config file.
new ESLintPlugin({
// Plugin options
extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
formatter: require.resolve('react-dev-utils/eslintFormatter'),
eslintPath: require.resolve('eslint'),
context: paths.appSrc,
failOnError: false, <== this one
emitWarning: true, <== and this one
// ESLint class options
cwd: paths.appPath,
resolvePluginsRelativeTo: __dirname,
baseConfig: {
extends: [require.resolve('eslint-config-react-app/base')],
rules: {
...(!hasJsxRuntime && {
'react/react-in-jsx-scope': 'error'
})
}
}
})
I was wondering if I can do the same thing but without having to eject the app, and use react-app-rewired instead, I already have a config-overrides.js file
module.exports = function override(webpackConfig) {
webpackConfig.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
});
return webpackConfig;
};
is there a similar way to access the ESLintPlugin function in webpack.config file and add new options to it through config-overrides.js file?