Skip to content

Bug: --ignore-pattern doesn't work well with --flag unstable_config_lookup_from_file #18948

@mdjermanovic

Description

@mdjermanovic

Environment

Node version: v20.12.0
npm version: 10.5.0
Local ESLint version: main branch
Global ESLint version:
Operating System: windows

What parser are you using?

Default (Espree)

What did you do?

There's an eslint.config.js file in tests/lib/eslint, so when the files in this directory are linted with --flag unstable_config_lookup_from_file, that config file is used.

Command (from the project root):

$ node bin/eslint tests/lib/eslint --ignore-pattern tests/lib/eslint/legacy-eslint.js --flag unstable_config_lookup_from_file

What did you expect to happen?

tests/lib/eslint/legacy-eslint.js to be ignored.

What actually happened?

It isn't ignored. The output is:

C:\projects\eslint\tests\lib\eslint\eslint.js
     7:1   error    'use strict' is unnecessary inside of modules                                       strict
   131:34  warning  Unused eslint-disable directive (no problems were reported from 'no-invalid-this')
   202:70  warning  Unused eslint-disable directive (no problems were reported from 'no-new')
   324:17  warning  Unused eslint-disable directive (no problems were reported from 'no-new')
   993:55  error    Strings must use doublequote                                                        quotes
  5787:17  error    Definition for rule 'n/no-unsupported-features/node-builtins' was not found         n/no-unsupported-features/node-builtins

C:\projects\eslint\tests\lib\eslint\legacy-eslint.js
     7:1   error    'use strict' is unnecessary inside of modules                                            strict
   103:34  warning  Unused eslint-disable directive (no problems were reported from 'no-invalid-this')
   158:17  warning  Unused eslint-disable directive (no problems were reported from 'no-new')
   167:65  warning  Unused eslint-disable directive (no problems were reported from 'no-new')
   938:18  error    Strings must use doublequote                                                             quotes
   942:13  warning  Unused eslint-disable directive (no problems were reported from 'no-underscore-dangle')
  5149:25  warning  Unused eslint-disable directive (no problems were reported from 'no-new')
  5175:21  warning  Unused eslint-disable directive (no problems were reported from 'no-new')
  5304:21  warning  Unused eslint-disable directive (no problems were reported from 'no-new')

✖ 15 problems (5 errors, 10 warnings)
  4 errors and 10 warnings potentially fixable with the `--fix` option.

Link to Minimal Reproducible Example

https://github.com/eslint/eslint

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

Related: #18742 (comment)

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionbugESLint is working incorrectlyneeds designImportant details about this change need to be discussedrepro:yesIssues with a reproducible example

Type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions