Skip to content
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

Add lintTextSync method? #156

Closed
tunnckoCore opened this issue Feb 20, 2017 · 3 comments · Fixed by #157
Closed

Add lintTextSync method? #156

tunnckoCore opened this issue Feb 20, 2017 · 3 comments · Fixed by #157

Comments

@tunnckoCore
Copy link

tunnckoCore commented Feb 20, 2017

It's not cool that .lintText requires a callback and ESLint's method is synchronous, but we here force cb for no reason. Or okey, at least add .lintTextSync method?

There is existing problem for https://github.com/dtinth/atom-prettier-standard-formatter, which is based on https://github.com/dtinth/prettier-standard-formatter, which uses promises, exactly because the standards lintText method.

ping @dtinth, stay tuned :)

feross added a commit that referenced this issue Feb 21, 2017
Fixes: #156

Before: standardEngine.lintText(text, [opts], callback)
After: results = standardEngine.lintText(text, [opts])

If an error occurs, an exception is thrown. Otherwise, a `results`
object is returned.
@feross
Copy link
Member

feross commented Feb 21, 2017

Fair point. There's no need for this to be async. PR here: #157

feross added a commit that referenced this issue Feb 21, 2017
Fixes: #156

Before: standardEngine.lintText(text, [opts], callback)
After: results = standardEngine.lintText(text, [opts])

If an error occurs, an exception is thrown. Otherwise, a `results`
object is returned.
feross added a commit that referenced this issue Feb 21, 2017
Fixes: #156

Before: standardEngine.lintText(text, [opts], callback)
After: results = standardEngine.lintText(text, [opts])

If an error occurs, an exception is thrown. Otherwise, a `results`
object is returned.
@tunnckoCore
Copy link
Author

cool, thanks

@Flet Flet closed this as completed in #157 Feb 21, 2017
feross added a commit that referenced this issue Apr 4, 2017
Fixes: standard/standard#807

- BREAKING: rename the syncronous `lintText` method to `lintTextSync`
- Add an asyncronous `lintText` method (that just calls `lintTextSync`
internally)

This effectively undoes the breaking change introduced in 6.0.0, making
it safe to
upgrade from `standard-engine` 5.x to 7.x without introducing any
breaking changes.

Related: #156
@feross
Copy link
Member

feross commented Apr 4, 2017

FYI, this PR affects the lintText method: #159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants