eslint / rewrite

Monorepo for the new version of ESLint
Apache License 2.0
169 stars 11 forks source link

Bug: (In flatfile config, includeIgnoreFile not working due to having "name" key in the object) #116

Closed tlkiong closed 3 months ago

tlkiong commented 3 months ago

Which packages are affected?

Environment

Node version: 22.2.0 npm version: 10.7.0 ESLint version: 8.5.0 Operating System: MacOS Sonoma 14.0

What did you do?

export default [
    includeIgnoreFile(gitignorePath),
]

What did you expect to happen?

Expect dist/ dir to be ignored

What actually happened?

Wasn't ignored

Link to Minimal Reproducible Example

-

Participation

Additional comments

As mentioned https://github.com/eslint/eslint/issues/18723, the config of in `eslint.config.js:

export default [
    includeIgnoreFile(gitignorePath),
    // putting other config here
]

Will not work. However, doing:

export default [
    {
      ignores: includeIgnoreFile(gitignorePath).ignores
    },
    // putting other config here
]

work

nzakas commented 3 months ago

The compat package is for use with ESLint v9 and higher. If you upgrade, it should work just fine.

We'll also be fixing this in v8.x, which is being tracked on https://github.com/eslint/eslint/issues/18723