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
Add files: []
to the configuration object
#3860
Comments
Thanks for listing out the benefits and noting a similar approach in AVA and XO. This sounds like a good idea. It's related to #3411, which is also about improving the experience of using stylelint. |
I guess no one has a clue so Ill just use common sense and pick what seems the best if I ever work on this one. |
Also, we need to consider @Mouvedia's questions on #3860 (comment). |
Labelling as ready to implement following the discussion in #6689. Picking up #6689 (comment) Let's support strings and an array of strings to be consistent with the other options, including all secondary options for rules. In hindsight, accepting strings was probably a mistake, but we have consistently done it for our options. We can consider moving to arrays only in a major release. |
files: []
to the configuration object
I try responding to some questions in #3860 (comment).
I think it makes sense to allow negation patterns for There should be no problems even if people use both negation patterns in
I think we should continue to support |
Would a pattern |
No, the current behavior (ignoring Line 26 in b92260f
|
Is this issue ready to be implemented? |
If we introduce the flat config (#7408), this issue no longer seems to be needed; otherwise, at least, it seems to need to reconsider an expected behavior. |
There's quite a bit to consider here. We want to enable We can use module.exports = {
"files": ["**/*.css"],
"rules": { "color-no-named": true }
} Would:
The latter makes the Node.js API We may also want to add an The behaviour that'd be triggered by We'll need to be clear in our documentation that using Do we think this approach is worth exploring? If so, we'll likely want to put together a PoC PR to assess whether it's possible to have the current and new behaviours work alongside each other and the code complexity of doing so. |
Can you separate this into its own issue and punt it to v17? |
Done in #7449. |
In my projects, I prefer to always glob for all CSS files
**/*.css
and rather ignore the few CSS files I want instead of explicitly specify every file. When having to specify the files, it's easy to forget some files, especially when they're added later.I would like to see a top-level setting called
files
that accepts an array of strings. I could then setfiles: ['**/*.css'],
in my shareable config and use theignoreFiles
in my projects to ignore project-specific files.There are other benefits to specifying the files in a config object:
Before:
{"lint": "xo && stylelint foo.js bar.js 'fixtures/*.css'"}
After:
{"lint": "xo && stylelint"}
files
config and know which files to lint. It cannot reliably parse the run script commands.I have had
files
config in both the AVA and XO projects for years with great success.This is a duplicate of #2580, but I chose to open a new issue as I feel I have a different use-case and many more arguments for why it makes sense.
The text was updated successfully, but these errors were encountered: