@@ -27,6 +27,7 @@ const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
2727const  WatchMissingNodeModulesPlugin  =  require ( 'react-dev-utils/WatchMissingNodeModulesPlugin' ) ; 
2828const  ModuleScopePlugin  =  require ( 'react-dev-utils/ModuleScopePlugin' ) ; 
2929const  getCSSModuleLocalIdent  =  require ( 'react-dev-utils/getCSSModuleLocalIdent' ) ; 
30+ const  ESLintPlugin  =  require ( 'eslint-webpack-plugin' ) ; 
3031const  paths  =  require ( './paths' ) ; 
3132const  modules  =  require ( './modules' ) ; 
3233const  getClientEnvironment  =  require ( './env' ) ; 
@@ -351,29 +352,6 @@ module.exports = function (webpackEnv) {
351352      rules : [ 
352353        // Disable require.ensure as it's not a standard language feature. 
353354        {  parser : {  requireEnsure : false  }  } , 
354- 
355-         // First, run the linter. 
356-         // It's important to do this before Babel processes the JS. 
357-         { 
358-           test : / \. ( j s | m j s | j s x | t s | t s x ) $ / , 
359-           enforce : 'pre' , 
360-           use : [ 
361-             { 
362-               options : { 
363-                 cache : true , 
364-                 cwd : paths . appPath , 
365-                 formatter : require . resolve ( 'react-dev-utils/eslintFormatter' ) , 
366-                 eslintPath : require . resolve ( 'eslint' ) , 
367-                 resolvePluginsRelativeTo : __dirname , 
368-                 baseConfig : { 
369-                   extends : [ require . resolve ( 'eslint-config-react-app/base' ) ] , 
370-                 } , 
371-               } , 
372-               loader : require . resolve ( 'eslint-loader' ) , 
373-             } , 
374-           ] , 
375-           include : paths . appSrc , 
376-         } , 
377355        { 
378356          // "oneOf" will traverse all following loaders until one will 
379357          // match the requirements. When no loader matches it will fall 
@@ -742,6 +720,19 @@ module.exports = function (webpackEnv) {
742720          // The formatter is invoked directly in WebpackDevServerUtils during development 
743721          formatter : isEnvProduction  ? typescriptFormatter  : undefined , 
744722        } ) , 
723+       new  ESLintPlugin ( { 
724+         // Plugin options 
725+         extensions : [ 'js' ,  'mjs' ,  'jsx' ,  'ts' ,  'tsx' ] , 
726+         formatter : require . resolve ( 'react-dev-utils/eslintFormatter' ) , 
727+         eslintPath : require . resolve ( 'eslint' ) , 
728+         context : paths . appSrc , 
729+         // ESLint class options 
730+         cwd : paths . appPath , 
731+         resolvePluginsRelativeTo : __dirname , 
732+         baseConfig : { 
733+           extends : [ require . resolve ( 'eslint-config-react-app/base' ) ] , 
734+         } , 
735+       } ) , 
745736    ] . filter ( Boolean ) , 
746737    // Some libraries import Node modules but don't use them in the browser. 
747738    // Tell webpack to provide empty mocks for them so importing them works. 
0 commit comments