-
Notifications
You must be signed in to change notification settings - Fork 510
Conversation
this._ruleSettings = processedSettings; | ||
}; | ||
|
||
Configuration.prototype.getProcessedConfig = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs are missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot it, thanks! Will fix today!
This is amazing work @mdevils. Bravo on getting this done and fully tested. I have no glaring problems with this approach; I'm sure issues will arise in the near future we start working with (and extending) this new format. 👍 |
Thank you for your opinion and comments, Joel! |
Fixed all the issues. Check it out again, please. |
Unfortunately, nothing about Am I right about registering plugin rules in global rule space? Is it legal? Is it right? If it is then I there would be conflicts. But also there could be extensions of basic rules probably... What we decide about it? upd: I though we are in progress... But feels like I've missed something. |
@zxqfox, the problem you are talking about does not exist yet. Implementing any solution for this problem now will result in much higher complexity, which I would not like to have. In future it will not be a breaking change to introduce namespacing. But I believe, we should do this ONLY if we realize the problem exists and it is serious enough. |
@mdevils I've stuck in loading something what I've called So the main problem just in data preparation before calling rules itself. Atm I see 2 solutions.
If we going (1) we should change jscs itself to call some triggers (or something) before calling rules that registered by plugin. While for (2) we don't need to change anything in So for (1) plugin developer would register each rules independently and also probably some triggers for some events (to force parsing jsdoc once after esprima did some with file). While for (2) there are no difference in registering rules because we should do it manually in plugins. For sure I believe it should be done in jscs for D.R.Y. and some optimizations (to call only what user want). At least would be great if some suboption logic will be shared with plugins (to not repeat this code in each plugin). But actually, if consumer uses this plugin by declaring it in config then he knows what he doing ... Well I hope you see now what I'm talking about. |
@zxqfox, hard to get the idea. Can you put examples to describe it? Configuration examples? |
@mdevils I've had some ideas In plugin we can do something like registering helpers for a bunch of rules (or in global space): config.registerFileHelper('jsdoc-comments-parser');
config.registerRule('jsdoc-some-rule');
config.registerRule('jsdoc-another-rule'); And then in rules we've got already parsed jsdoc comments in file object. Or some special methods for parsing and caching them in Or maybe we can just extend basic classes with some additional helpers to find scopes (closest function in es-ast), blocks (closest block scope for So atm I can't parse file comments once (or maybe can with ast tree fixing, or caching in helper), iterate once, and register multiple different rules that using parsed comments. It's not a big trouble because we can live without it, but it would be great if there will be a simple mechanism in jscs to provide some hooks for plugins. Atm it's registering rules, configuring rules, and checking files. Probably we can expose something else? To be clear, my need is |
Can we move the discussion of the plugin system to another issue? I'd like to land this config change since it's holding up other PRs. |
@mrjoelkemp Yeah, sure. Sorry 🍭 |
@zxqfox please create an issue so we can keep our discussion going. |
Merged this. |
@mdevils could create a repo with plugin example? |
@markelog Take a look at https://github.com/zxqfox/node-jscs-plugin-tpl |
@zxqfox i saw it, but i was asking about new plugin interface that introduced in this pull. Like how you should install it and configure it. |
@markelog I can do that if you want |
That would be helpful |
|
|
What I did for this pull-request:
@mikesherov, @markelog, @mrjoelkemp, please take a look.
(I will squash the changes before the merge)