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
Automatically configure alternative syntax scopes when available #16
Comments
@IssueHunt has funded $80.00 to this issue.
|
Hi! 👋 XO uses the standard plugins just like eslint? (T.i. not some variants.) If so, it is basically enough to look at the (I consider implementing this, and want to know how much code share between eslint and XO I could have.) |
Fixes xojs#16 The strategy here is to use a wide `selector` in the beginning and then narrow it down during actual linting. SublimeLinter needs a good `selector` as a **fast** check to match views and installed linters because this first check runs on a shared worker. T.i. we cannot just select *all* views and then decide later. After the first check, it is always possible to abort loud or silently. We do here silently because it's not a configuration error coming from the user but an automatic algorithm bailing out. With this implementation there comes the drawback that we have to flip the previous default behavior. The default behavior was for the linter to run on parts of the buffer marked as `source.js` concurrently. E.g. it did run on the `<script>` tags when viewing a HTML file. However, this default often did not produce good results. I.e. in an HTML file it has no notion of gloabls introduced in one script which are accessible in another script. If the user wants this behavior, she now has to opt in by setting the old selector `'source.js - meta.attribute-with-value'` in the settings on her own. Implementation risks: - We deep import `read_json_file`. It is possible that this import can break since deep imports are not protected by any deprecation policy. - We have two side-effects: `self.notify_unassign()` followed by `raise PermanentError()`. It is possible that in the future we need to signal the same outcome differently.
@sindresorhus has rewarded $72.00 to @kaste. See it on IssueHunt
|
Users can add plugins to XO to enable support for alternative syntax:
It would be useful if the XO binary could have a private CLI flag to share this information and then this plugin could somehow dynamically set the
selector
setting:SublimeLinter-contrib-xo/linter.py
Line 13 in 29aac0b
Currently, the user has to do this manually, which is not a great experience.
This issue requires fairly high understanding of JS and good problem-solving skills.
Some hints on how to solve it here: SublimeLinter/SublimeLinter-eslint#253 (comment)
IssueHunt Summary
kaste has been rewarded.
Backers (Total: $80.00)
Submitted pull Requests
Tips
IssueHunt has been backed by the following sponsors. Become a sponsor
The text was updated successfully, but these errors were encountered: