You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: empty name should be allowed in globalIgnores #522
If you pass an empty name to the globalIgnores function, its return object will actually include globalIgnores <id> name .
What did you expect to happen?
Empty name is allowed in the flat config object.
What's more, in most config helper, like includeIgnoreFile, empty name is accepted. globalIgnores should follow this as this is also highly likely to be a mistake.
I am willing to submit a pull request for this issue.
AI acknowledgment
I did not use AI to generate this issue report.
(If the above is not checked) I have reviewed the AI-generated content before submitting.
Additional comments
I found this problem while developing a personal project and viewing ESLint's source code, I used AI tools to generate a PR (#521) to fix this inconsistency which didn't follow the AI policy, this is the issue for discussion.
As I asked on the PR, what is the purpose of using an empty name?
The purpose of the property is that you can more easily understand your config, e.g. via tools like eslint config inspector.
An empty name does not help with debugging your configuration while the generated name does help.
As I asked on the PR, what is the purpose of using an empty name? The purpose of the property is that you can more easily understand your config, e.g. via tools like eslint config inspector. An empty name does not help with debugging your configuration while the generated name does help.
I don't have an exact purpose here, I just noticed while browsing the code that the two helpers handle empty names inconsistently (includeIgnoreFile vs globalIgnores).
If the team decides to disallow empty name for generated config item, we should also follow it in other helpers like includeIgnoreFile.
And the reason why I suggest to allow empty name rather than using generated name in other helpers is using || to provide a fallback/default value for a nullable string instead of ?? is uncommon as a typescript developer, there is even an ESLint rule in typescript-eslint plugin to find this typescript/prefer-nullish-coalescing.
Activity
DMartens commentedon Oct 5, 2026
As I asked on the PR, what is the purpose of using an empty name?
The purpose of the property is that you can more easily understand your config, e.g. via tools like eslint config inspector.
An empty name does not help with debugging your configuration while the generated name does help.
liangmiQwQ commentedon Oct 5, 2026
I don't have an exact purpose here, I just noticed while browsing the code that the two helpers handle empty names inconsistently (
includeIgnoreFilevsglobalIgnores).If the team decides to disallow empty name for generated config item, we should also follow it in other helpers like
includeIgnoreFile.And the reason why I suggest to allow empty name rather than using generated name in other helpers is using
||to provide a fallback/default value for a nullablestringinstead of??is uncommon as a typescript developer, there is even an ESLint rule intypescript-eslintplugin to find thistypescript/prefer-nullish-coalescing.And, thanks for your time.