-
Notifications
You must be signed in to change notification settings - Fork 509
Make preset
more useful
#109
Comments
Relevant JSHint feature: jshint/jshint#1314 |
How would one differentiate between real node module and built-in preset config? How about check for the built-in first? Also not sure about the first step, we could easily check it presence through Browser version should still be able to work with built-in presets, so it might require to disperse preset logic between |
Sure, you shouldn't name your own preset the same as the built-in ones anyway.
Sure, was just a quick braindump. |
I suggest using another option name: |
I suggest we look at the way
You can reference rules in your own config by use namespaces:
You can also include multiple full presets. Including presets also runs the config of the preset. Multiple presets are defined in an array with conflicting rules being resolved by having the last declaration win. You can override those values on your own of course.
All standards are defined |
And to echo what @sindresorhus said, we can also have NPM module lookups. The point I was making is simply about what a preset is, and how to include one (or many!) in your config. |
Can take this one if @zxqfox don't mind |
@markelog Feel free! I wanted to have deep extension here if possible: jscs-dev/jscs-jsdoc#83 . There were idea to split google (with closurecompiler specific tags), wiki (with other set), etc. To mix jscs and plugin presets. |
Yeah, sounds good to me too. Just trying to get old issues addressed. |
I agree that we can solve original issue (according to current roadmap) and make another issue for future. Just need to know what we should solve here. |
Ability to load a preset by use of |
@mikesherov We already have I can suggest defining "jscs" or "jscs-plugin" right in package.json with "presets" section if we need something more but it looks pretty complex.
We already have package.json usage: https://github.com/jscs-dev/node-jscs/blob/master/test/data/configs/mixedWithPkg/package.json |
@zxqfox preset option might be simple alternative to the plugin interface, so it would be easy to share such configs without digging into the API. But i agree, it looks like creating plugin is easy too. @mikesherov thoughts? |
@markelog I'm not against some sugar for presets. Feels like it would be very helpful for preset makers. |
It might be, or it might be duplicative. Not sure |
My opinion is the same as before, making a preset should be as simple as creating json file and publishing it to NPM. |
So... Consumer's config (
And
Publisher should name his NPM-package with upd Here's a caveat with @markelog @mikesherov Please correct me if I wrong. @markelog And feel free to take this ;-) I'll be back in a couple days. |
I would think the publisher would name her package
This way, there is no magic. But I'm also fine if we want JSCS to assume
|
I'd modify Mike's example to avoid mentioning jscs all together, just to show that the prefix is unimportant:
Where |
@mrjoelkemp yes, that's what I meant in my first example. |
@mrjoelkemp In that case we require some jscs-preset/-plugin field in NPM Okay. I think we need make something to make this talk subjective. |
@markelog Is this function implemented? |
Nope, proposed pull for it, considered as not back-compat, so only in 2.0 :-( |
@markelog OK, thanks. |
re #54
As it stands now
preset
isn't very useful as it only has thejquery
style. Seeing as the config is fairly verbose it would be nice to have some ways to reuse it.Would be useful if
preset
could have a searchpath in this order:"main"
in package.json can be a .json file it could be the preset and requiring the module, would give you the preset config object.The text was updated successfully, but these errors were encountered: