Skip to content

Commit

Permalink
fix(eslint): run eslint only in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepolischuk committed Apr 2, 2024
1 parent 2b2a9bc commit b4a8c00
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ const ESLintPlugin = require('eslint-webpack-plugin')
const formatter = require('react-dev-utils/eslintFormatter')

module.exports = (options = {}) => ({
modifyWebpackConfig({webpackConfig}) {
webpackConfig.plugins = [
new ESLintPlugin({
cache: false,
extensions: ['js', 'jsx', 'ts', 'tsx'],
...options,
formatter
}),
...webpackConfig.plugins
]
modifyWebpackConfig({env: {dev: isDev}, webpackConfig}) {
if (isDev) {
webpackConfig.plugins = [
new ESLintPlugin({
cache: false,
extensions: ['js', 'jsx', 'ts', 'tsx'],
...options,
formatter
}),
...webpackConfig.plugins
]
}

return webpackConfig
}
Expand Down

0 comments on commit b4a8c00

Please sign in to comment.