Skip to content

Change introduced in #732 is causing issues when eslintrc location is customized #789

@rrajkomar

Description

@rrajkomar

Prior to the change intordiced in #732 (ESLint 5), one could pass an options array parameters (configFile) to configure the eslintrc file location.

With this change, that configuration (moved from enableEslintLoader to configureLoaderRule in the process) does not work anymore unless another eslintrc file is located at the default location.

This is because this blocks throws an Error :

try {
            if (typeof engine.getConfigForFile === 'function') {
                logger.debug('Checking ESLint 6+ configuration...');
                engine.getConfigForFile('webpack.config.js');
            } else {
                logger.debug('Checking ESLint 5 configuration...');
                engine.config.getConfigHierarchy(webpackConfig.runtimeConfig.context);
            }
        } catch (e) {
            if (isMissingConfigError(e)) {
[...]

before the custom configuration is applied:

return applyOptionsCallback(webpackConfig.eslintLoaderOptionsCallback, eslintLoaderOptions);

Can the custom configuration not be applied before said test ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions