Presets? #245

Open
kevinSuttle opened this Issue Dec 8, 2015 · 13 comments

Projects

None yet

3 participants

@kevinSuttle

Thinking about editorconfig/editorconfig-core-js#30, it would be handy to have a collection of presets.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@xuhdev
Member
xuhdev commented Dec 8, 2015

Can you explain a bit more? I don't understand your point on the js package (p.s. I'm not familiar with js)

@kevinSuttle

So, instead of having a separate .eslintrc file, there are defined presets that can be leveraged via custom configuration objects in package.json, [like Gemfile, requirements.txt, etc., but for JS].

Example from airbnb: https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb

package.json

eslintConfig
{
   "extends": "airbnb/base"
}
@sindresorhus
Member

👍 !!

I have this .editorconfig file duplicated in hundreds of repos...

@kevinSuttle

☝️ Yep. That's exactly the problem I'm hoping to solve.

@xuhdev
Member
xuhdev commented Dec 9, 2015

It makes sense for me. This seems like a editorconfig-core-js specific issue.... Can we move the discussion there?

@kevinSuttle kevinSuttle closed this Dec 9, 2015
@kevinSuttle kevinSuttle referenced this issue in kevinSuttle/github Dec 10, 2015
Closed

Redirecting/transferring of issues #37

@sindresorhus
Member

It's not specific to JS. That was just an example. For presets to be actually usable, they need to be supported by all EditorConfig implementations, not just the JS one. It should work even if I for example use the EditorConfig Sublime plugin.

I'm thinking:

# .editorconfig
extends = path/to/folder/containing/editorconfig/file

(Putting EditorConfig config into package.json should be a separate issue, on this issue tracker, as it also pertains to all implementation).

@sindresorhus sindresorhus reopened this Dec 10, 2015
@kevinSuttle

@sindresorhus I'm all for consolidation. What about a global in ~/.config/editorconfig?

@sindresorhus
Member

@kevinSuttle That doesn't really solve my issue of having to put an .editorconfig file in every repo. The point is that other users follows it, not me. You can already put a .editorconfig file in ~/ if you don't put root = true in your local .editorconfig files.

@kevinSuttle

Ah, I did not know that. I was thinking more of the global ~/.gitignore and ~/.npmrc so an .editorconfig file doesn't have to be present in every repo.

But I see your point about ensuring others follow suit and apply the same settings when the repo is distributed.

@xuhdev
Member
xuhdev commented Dec 11, 2015

I agree with @sindresorhus , it is exactly the reason we don't support a "global" configuration file.

@sindresorhus If we have an "extends" or "include" instruction, is the package.json issue still relevant?

@kevinSuttle

@xuhdev Yes. See above #245 (comment)

@sindresorhus
Member

If we have an "extends" or "include" instruction, is the package.json issue still relevant?

Yes, but that's a discussion for a different issue, but tl;dr; I have so many metafiles (.editorconfig, .gitignore, .gitattributes, etc) in my repos and I would like to reduce that number. Would be nice if I could define EditorConfig config in package.json instead of an .editorconfig file, since I almost always have a package.json file in my repos. Many other tools supports this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment