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
[feat/discussion] allow an option to get rule meta data for lintText #590
Comments
Alternatively, we could just expose |
We could...the only issue with that is that it is less efficient, in that to do that you'd need to gather up the options 2x and instantiate eslint again separate from the eslint instance that creates the report. I think cosmic config caches everything so it shouldn't be much overhead? That would be my only worry. @sindresorhus If you let me know which method you'd prefer. I'd be glad to submit a PR for this when I get the time. |
Let's go with what you proposed. Sounds better. |
decided that there isn't an explicit need for this in xo, since xo generates links with this package, via the pretty formatter. https://www.npmjs.com/package/eslint-rule-docs - which I am also now using in the extension for the same purpose. |
I was looking into making diagnostics in the vscode extension link to the rule documentation, if available, in the UI. This is accomplished via the engine.getRulesMetaForResults method and is most likely best done in the lintText/lintFiles methods.
After taking a look the simplest way to accomplish this for lintText may something like a very simple 1-2 liner:
I didn't dig too deep into lintFiles, it looks like it'd be more complex, but I'm not sure if it's something we'd even want from the CLI perspective. For my use case here, I would only need it on
lintText
results.The text was updated successfully, but these errors were encountered: