-
-
Notifications
You must be signed in to change notification settings - Fork 152
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] Can you please provide sync
API with async
together?
#756
Comments
I will not plan that implement sync API. ESLint will support async API in the future. Also, textlint-rule-eslint integrate with ESLint. |
Yes, but it requires a long time to go.
Thanks for this suggestion, I'll give it a try.
It aims different things as my purpose, it runs ESLint for JavaScript codes just like But what I'm doing is run |
Many tools support |
@azu I'm doing similar things for We can test |
Comparing cosmiconfig is not fair. unified support async plugin, but it just throws an Error on var vfile = require("vfile");
var unified = require("unified");
var f = vfile("alpha");
var n = { type: "bravo" };
var e = { type: "charlie" };
const file = unified().use(plugin).runSync(n, f);
console.log(file);
function plugin() {
return transformer;
}
async function transformer(tree, file) {
console.log(tree, file);
return e;
}
https://runkit.com/azu/6083a90f2912a2001a3a1fe8 In my experience, 20 - 30% of rules use async API. Sync to async is easy, but the reverse is difficult. Thanks for suggestion. |
Yes, I've mentioned:
That's unfortunately if you've decided that. Or may I raise a PR first to see how difficult would it cost? That's OK if you decide not to merge that even. |
Yes! |
Closed by #757 (comment) |
All APIs changed to be
async
in #75, but it would be great to still support legacysync
APIs.I'm trying to integrate this tool to ESLint which does not support
async
rule for now.So my proposal is to add
lintTextSync
,fixTextSync
APIs, etc.Some async rules like
textlint-rule-no-dead-link
won't work forsync
API, that's OK, the user should just disableasync
rules if they want to usesync
API.If you agree, I'm glad to raise a PR for it.
The text was updated successfully, but these errors were encountered: