One of the benefits of using webpack 4 is the ability to run eslint across the entire project folder with a specific configuration.
{
enforce: 'pre',
test: /\.js|ts$/,
exclude: /node_modules/,
loader: 'eslint-loader'
},
However, there may be cases where you want to run eslint in the node_modules of a particular folder that is npm linked and not compiled. To achieve this, you can use regular expressions like the following:
{
enforce: 'pre',
test: /\.js|ts$/,
exclude: /node_modules\/(?!(my-folder)\/).*/,
loader: 'eslint-loader'
},
Unfortunately, this approach did not work as expected. Can anyone suggest how to properly achieve this?