-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
New: Array Config #21
Conversation
Thanks for working on this RFC! I don't feel strongly either way, but I'm unsure about how useful this would actually be for users. It's not clear to me that users would find array configs less confusing than Also, it seems like users could accidentally create an error by doing something like this: // ./.eslintrc.js
module.exports = [
require('eslint-config-foo'),
{ /* additional config */ }
]; // ./node_modules/eslint-config-foo/index.js
module.exports = {
parser: 'my-parser'
}; // ./node_modules/eslint-config-foo/node_modules/my-parser/index.js
module.exports = { /* (parser implementation) */ }; In this case, the end user's array config could appear to work at first, but it would break if the shareable config started to depend on relative paths. |
Yeah, actually, I don't feel strongly, too. A use case I thought is to address conflicted |
This would bring |
Actually, I'm still opposing #9 because that's fragile and we don't need to break all users' configs completely. |
Array config seems like it’d make migration to the more powerful object form painful; whereas the initial pain of using an object (when this RFC would allow an array) is minimal. |
@ljharb I think the array form is as powerful as the object form, so it doesn't seem like a migration of that kind would be necessary. (Object configs are processed internally by compiling them into something resembling the array configs from this proposal.) |
Array configs would also make migration to Once that gets implemented at some unknown point in the future. |
I’m keeping that in mind, that’s why I said at some unknown point in the future when the decision about #9 actually gets made. |
I don't feel strongly about it, but I'm leaning against supporting this RFC because it's not clear that allowing array configs would be useful, and it might lead to some confusion (by having another way to do things). |
Thank you all for the discussion in this thread and particularly @mysticatea for putting the RFC together! Now that we've decided on a direction to take configs going forward in #9, the TSC decided today to close the other config-related RFCs so we can focus on the new format. You can follow along with that implementation work at eslint/eslint#13481. |
This was separated from #13.
Summary
This proposal makes
.eslintrc
files allowing an array as the top-level config. This is a syntax sugar ofextends
property andoverrides
property to make configuration simpler. Also, this form is closer to ESLint internal structure about configuration (ConfigArray
).Related Issues