Skip to content

options.files not working with paths/globs that are relative to options.context #96

@stankovic84

Description

@stankovic84
  • Operating System: ubuntu
  • Node Version: 12.4
  • NPM Version: 6.3
  • webpack Version: 5
  • eslint-webpack-plugin Version: 2.5.3

Expected Behavior

When I set options.files strings (array) so that they are relative to context, files in those relative paths should be linted.

Setup with same path values, but different file extensions, works as expected for styles in https://github.com/webpack-contrib/stylelint-webpack-plugin. This plugin also has options.files/options.context type of setup.

Actual Behavior

Files that are outside options.context are not linted. Issue happens both with glob pattern paths and directory paths.

Code

Here, webpack is running in main-app (context). Paths are given and were tested as plain strings.

new ESLintPlugin({
    context: '/home/user/project-name/packages/main-app/src',
    files: [ 
        '**/*.(js|jsx|mjs)', 
        '../../package-a/src/**/*.(js|jsx|mjs)', 
        '../../package-b/src/**/*.(js|jsx|mjs)',
    ],
})

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions