-
Notifications
You must be signed in to change notification settings - Fork 142
Rule documentation questions #590
Comments
|
Marking as closed since there was no further response. |
Sorry about the lack of response, my bad...
Don't see a problem with it either, mostly curious about this. I deprecated my plugin, and it is being downloaded more than ever, so yeah, probably better to just keep supporting them.
Very understandable choice. The experience would be so much better though if it was possible while not degrading the user experience. I think it's pretty hard to do pre-fetching as you don't go and fetch the list of used ESLint rules yourself, right?
In the case of I think this could also be used for other editor linters (probably not Sublime as it's written in Python), but the linter for Visual Studio Code, or simply eslint formatters (they might give you a clickable link in the console for instance). By the way, if this should be moved to another repo, the repo could be set up in a simpler way (no compiling I mean), and people could contribute using only the GitHub website (kind of like this).
I'd have to check, as I haven't written/seen any yet (so maybe you should wait until there's a real live example and request for it), but the problem with what I've seen is the way the ruleId is parsed const ruleParts = ruleId.split('/')
if (ruleParts.length === 1) {
return `http://eslint.org/docs/rules/${ruleId}`
}
const pluginName = ruleParts[0]
const ruleName = ruleParts[1] I'm pretty sure that the rule would be configured with |
Correct, this plugin just requests
I was talking about other Atom providers, but I can see how a generic list like that could work for others. I personally am not interested in maintaining that separately, though if somebody wanted to set that up and submitted a PR here utilizing it I'd be fine with moving over to it 馃槈.
That's how scoped packages look when they are specified in the |
Honestly I'm not sure, no. I've not used scoped packages before. Should be fairly easy to figure out with some experimenting, but I don't have time at the moment. |
Me either, we can figure it out when somebody actually uses them and (potentially) runs into an issue I guess 馃槢. |
I'm interested in doing this. @sindresorhus would you be interested in having this functionality in |
@jfmengels 馃憤 |
FYI, finally got to working on this, and I finally created that separate repo https://github.com/jfmengels/eslint-rule-documentation/. If you have some feedback before I publish this, I'm all ears! Thanks! |
Sweet, I like it. Would you be willing to submit a PR to linter-eslint to switch us over to using it? |
Yes. I'll try to find some time for this, and I'll see how it goes (I have never worked with atom plugins before, and I would like to test it properly when working on it ;)) Btw, I have added @Arcanemagus and @IanVS as collaborators for the repo. Feel free to add the people you deem apt to maintain, I don't know who worked on this the most. |
FYI: An already nice use of this list in eslint-find-rules |
@jfmengels FYI It looks like ESLint may be adding support for the rules themselves to specify a path to their own documentation: eslint/eslint#6582 I think your package will still be useful as a fallback for packages which do not specify doc urls though. (assuming this change even happens.) |
Ha, good to know, thanks for the info. I'll try to follow the story, but let me know if I missed something in the development of this :) |
Yeah I don't think it actually impacts your repo too much, I think it would be up to linter-eslint to fall back to yours iif the rule message we get from ESLint does not have a url. |
Ah, just now figured out that the url would appear in the problem object. Then yeah, I wouldn't have to update my repo and it would be just used as a fallback. That'd be great yeah! I actually thought this was proposing some kind of convention or something to have the doc field in the meta, so that we could fetch it by requiring the rule. Would be a lot more complicated. |
It's still in proposal phase so far, but yes, it looks like the current proposal would add the meta to the problem object. |
Yeah. I like it. That would allow a lot more flexibility and nice things to appear. |
eslint/eslint#6582 has finally been implemented. |
Hi there!
First off, thanks for building this tool, it's really great!
I just discovered the rule documentation feature (this one), and thought it was pretty neat. there's even my name in there, so 馃槃
I have a few questions and remarks:
https://github.com/<repo>/eslint-plugin-<name>/blob/master/docs/rules/${ruleName}.md
? Most plugins follow that convention I think (1 counter-example in the list currently).Maybe the linter could attempt to make a HTTP request to see if the page exists, and link to the the contribution page if it doesn't. There could still be an exception list.
And again, thanks for making this great tool! :)
The text was updated successfully, but these errors were encountered: