Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also
name
- I don't know if there will be any others in the future.Also, we need to display "invalid config" not just
v-else
as the ignores are not functional when other keys presents but notfiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless it's been changed in a recent release,
name
is also disallowed, something I discovered when building https://github.com/neostandard/neostandard/blob/bb370d2cec486eecd0f6057621b95628507eff5d/lib/main.js#L95-L100There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure the ignores are not functional when
files
is not there? As I commented here #80 (comment) I think they are?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the fix in humanwhocodes/config-array#131
And which is now in https://github.com/eslint/rewrite/blob/e2a7ec809db20e638abbad250d105ddbde88a8d5/packages/config-array/src/config-array.js#L76
The fix only seems to apply to ESLint 9 tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe we should have
@eslint/config-array
tell us then? Rather than re-implementing the check ourselvesIdeally it would use the same version of
@eslint/config-array
as in the ESLint version that the user is using, but I guess that could be trickyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we would rework
FlatConfigItem
fromconfig-inspector/shared/types.ts
Lines 4 to 9 in 59672f5
Then we could easily add a new key
ignoreGlobal
or such:And we could then move the
ConfigArray
creation fromglobMatchedFields()
and intoreadConfig()
itself and have it be available for such calculations there https://github.com/voxpelli/config-inspector/blob/59672f55fcd8779abbfd1e8a3042235fc8112ae3/src/configs.ts#L291-L300There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't even called
@eslint/config-array
before v8. I don't think we could have the capability of getting that information from@eslint/config-array
as we also need to "explains". I'd say they really should backport it to v8, as that is considered a bug. For config inspector, I'd say we better move forward to display based on the latest rule.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antfu Added a check for
name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am up to it, we could do that in another PR