Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the label condition #80

Closed
AlexRMU opened this issue Aug 1, 2024 · 4 comments · Fixed by #84
Closed

Error in the label condition #80

AlexRMU opened this issue Aug 1, 2024 · 4 comments · Fixed by #84

Comments

@AlexRMU
Copy link

AlexRMU commented Aug 1, 2024

The patterns act as global ignores if an ignores key is used without any other keys in the configuration object.
https://eslint.org/docs/latest/use/configure/ignore#ignoring-files

<div v-if="!config.files">
Ignore files globally
</div>

@antfu
Copy link
Collaborator

antfu commented Aug 7, 2024

What would you suggest? Would we instead output "Invalid config item" or something? Without files I guess ignores are meaningless if not being global.

@AlexRMU
Copy link
Author

AlexRMU commented Aug 7, 2024

Yes.

  • if there is a key ignores
    • if there are other keys
      • this is a regular configuration object
    • else
      • this is an global ignore object

@voxpelli
Copy link
Contributor

Why show an error when files is missing?

It's valid to have a config like:

export default [
  {
    files: ['lib/**/*.foo'],
    rules: {
      // Rules for lib/**/*.foo
    }
  },
  {
    ignores: ['lib/**/*.foo'],
    rules: {
      // Rules for everything but lib/**/*.foo
    }
  }
];

@AlexRMU
Copy link
Author

AlexRMU commented Aug 15, 2024

Yes.
Edited.

voxpelli added a commit to voxpelli/config-inspector that referenced this issue Aug 15, 2024
@antfu antfu closed this as completed in #84 Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants